Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 91ead4e

Browse files
committed
check parameters type
1 parent 943adcf commit 91ead4e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/gridstack.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@
180180
};
181181

182182
GridStackEngine.prototype.move_node = function (node, x, y, width, height, no_pack) {
183-
if (typeof x == 'undefined') x = node.x;
184-
if (typeof y == 'undefined') y = node.y;
185-
if (typeof width == 'undefined') width = node.width;
186-
if (typeof height == 'undefined') height = node.height;
183+
if (typeof x != 'number') x = node.x;
184+
if (typeof y != 'number') y = node.y;
185+
if (typeof width != 'number') width = node.width;
186+
if (typeof height != 'number') height = node.height;
187187

188188
if (typeof node.max_width != 'undefined') width = Math.min(width, node.max_width);
189189
if (typeof node.max_height != 'undefined') height = Math.min(height, node.max_height);

0 commit comments

Comments
 (0)