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

Skip to content

Commit b09ae61

Browse files
authored
Merge pull request gridstack#503 from radiolips/bugfix/481
Bugfix/481
2 parents a04a247 + 696b0f7 commit b09ae61

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,9 +476,10 @@ Changes
476476

477477
#### v0.2.6-dev (Development version)
478478

479-
- update requirements to the latest versions of jQuery and jquery-ui.
479+
- update requirements to the latest versions of jQuery (v3.1.0+) and jquery-ui (v1.12.0+).
480480
- fix jQuery `size()` ([#486](https://github.com/troolee/gridstack.js/issues/486)).
481481
- update _notify to allow detach ([#411](https://github.com/troolee/gridstack.js/issues/411)).
482+
- fix code that checks for jquery-ui ([#481](https://github.com/troolee/gridstack.js/issues/481)).
482483

483484
#### v0.2.5 (2016-03-02)
484485

dist/gridstack.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,9 @@
975975
};
976976

977977
GridStack.prototype._prepareElementsByNode = function(el, node) {
978+
if (typeof $.ui === 'undefined') {
979+
return;
980+
}
978981
var self = this;
979982

980983
var cellWidth;
@@ -1160,9 +1163,7 @@
11601163
}, triggerAddEvent);
11611164
el.data('_gridstack_node', node);
11621165

1163-
if (!this.opts.staticGrid) {
1164-
this._prepareElementsByNode(el, node);
1165-
}
1166+
this._prepareElementsByNode(el, node);
11661167
};
11671168

11681169
GridStack.prototype.setAnimation = function(enable) {
@@ -1258,7 +1259,7 @@
12581259
el.each(function(index, el) {
12591260
el = $(el);
12601261
var node = el.data('_gridstack_node');
1261-
if (self.opts.staticGrid || typeof node == 'undefined' || node === null) {
1262+
if (typeof node == 'undefined' || node === null || typeof $.ui === 'undefined') {
12621263
return;
12631264
}
12641265

@@ -1278,7 +1279,7 @@
12781279
el.each(function(index, el) {
12791280
el = $(el);
12801281
var node = el.data('_gridstack_node');
1281-
if (self.opts.staticGrid || typeof node == 'undefined' || node === null) {
1282+
if (typeof node == 'undefined' || node === null || typeof $.ui === 'undefined') {
12821283
return;
12831284
}
12841285

0 commit comments

Comments
 (0)