Skip to content

Commit 1f9560d

Browse files
author
Alain Dumesny
committed
grunt uglify not supporting ES6
1 parent 1c5bc14 commit 1f9560d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/gridstack.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,7 +1450,7 @@
14501450
node.resizeHandles = el.attr('data-gs-resize-handles');
14511451
node.id = el.attr('data-gs-id');
14521452
return node;
1453-
}
1453+
};
14541454

14551455
GridStack.prototype.setAnimation = function(enable) {
14561456
if (enable) {
@@ -1519,7 +1519,7 @@
15191519
if (detachNode !== false) {
15201520
delete this.grid._layouts;
15211521
// remove our data structure before list gets emptied and DOM elements stay behind
1522-
this.grid.nodes.forEach(node => { node.el.removeData('_gridstack_node'); });
1522+
this.grid.nodes.forEach(function(node) { node.el.removeData('_gridstack_node') });
15231523
}
15241524
this.grid.removeAll(detachNode);
15251525
this._triggerRemoveEvent();
@@ -1833,23 +1833,23 @@
18331833

18341834
// cache the current layout in case they want to go back (like 12 -> 1 -> 12) as it requires original data
18351835
var copy = [nodes.length];
1836-
nodes.forEach((n, i) => copy[i] = Utils.clone(n)); // clone to preserve _id that gets reset during removal, and changing x,y,w,h live objects
1836+
nodes.forEach(function(n, i) {copy[i] = Utils.clone(n)}); // clone to preserve _id that gets reset during removal, and changing x,y,w,h live objects
18371837
this.grid._layouts = this.grid._layouts || {};
18381838
this.grid._layouts[oldColumn] = copy;
18391839

18401840
// see if we have cached prev values and if so re-use those nodes that are still current...
18411841
var newNodes = [];
18421842
var cacheNodes = this.grid._layouts[column] || [];
1843-
cacheNodes.forEach(cacheNode => {
1844-
var j = nodes.findIndex(n => n && n._id === cacheNode._id);
1843+
cacheNodes.forEach(function(cacheNode) {
1844+
var j = nodes.findIndex(function(n) {return n && n._id === cacheNode._id});
18451845
if (j !== -1) {
18461846
newNodes.push(cacheNode); // still current, use cache info
18471847
nodes[j] = null;
18481848
}
18491849
});
18501850
// ...and add any extra non-cached ones
18511851
var ratio = column / oldColumn;
1852-
nodes.forEach(node => {
1852+
nodes.forEach(function(node) {
18531853
if (!node) return;
18541854
newNodes.push($.extend({}, node, {x: Math.round(node.x * ratio), width: Math.round(node.width * ratio) || 1}));
18551855
});
@@ -1859,11 +1859,11 @@
18591859
// (batch mode will set float=true so we can position anywhere and do gravity relayout after)
18601860
this.batchUpdate();
18611861
this.grid.removeAll(false); // 'false' = leave DOm elements behind
1862-
newNodes.forEach(node => {
1862+
newNodes.forEach(function(node) {
18631863
var newNode = this.addWidget(node.el, node).data('_gridstack_node');
18641864
newNode._id = node._id; // keep same ID so we can re-use caches
18651865
newNode._dirty = true;
1866-
});
1866+
}, this);
18671867
this.grid._removedNodes = []; // prevent add/remove from being called (kept DOM) only change event
18681868
this.grid._addedNodes = [];
18691869
this.commit();

0 commit comments

Comments
 (0)