Skip to content

Commit 7c58641

Browse files
committed
fix #267
1 parent c43a12a commit 7c58641

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,7 @@ Changes
828828
- add `enableMove`/`enableResize` methods.
829829
- fix window resize issue #331.
830830
- add options `disableDrag` and `disableResize`.
831+
- fix `batchUpdate`/`commit` (Thank to @radiolips)
831832

832833
#### v0.2.4 (2016-02-15)
833834

dist/gridstack.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@
131131
};
132132

133133
GridStackEngine.prototype.commit = function() {
134-
this._updateCounter = 0;
135-
if (this._updateCounter === 0) {
134+
if (this._updateCounter !== 0) {
135+
this._updateCounter = 0;
136136
this.float = this._float;
137137
this._packNodes();
138138
this._notify();
@@ -269,6 +269,9 @@
269269
};
270270

271271
GridStackEngine.prototype.cleanNodes = function() {
272+
if (this._updateCounter) {
273+
return;
274+
}
272275
_.each(this.nodes, function(n) {n._dirty = false; });
273276
};
274277

dist/gridstack.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/gridstack.min.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/gridstack.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@
131131
};
132132

133133
GridStackEngine.prototype.commit = function() {
134-
this._updateCounter = 0;
135-
if (this._updateCounter === 0) {
134+
if (this._updateCounter !== 0) {
135+
this._updateCounter = 0;
136136
this.float = this._float;
137137
this._packNodes();
138138
this._notify();
@@ -269,6 +269,9 @@
269269
};
270270

271271
GridStackEngine.prototype.cleanNodes = function() {
272+
if (this._updateCounter) {
273+
return;
274+
}
272275
_.each(this.nodes, function(n) {n._dirty = false; });
273276
};
274277

0 commit comments

Comments
 (0)