From 92c0941f75074f42280ff15424a20dc3c37dd7bb Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 17 Jan 2016 16:51:48 -0500 Subject: Do not check board status during task move --- assets/js/src/Board.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'assets/js/src') diff --git a/assets/js/src/Board.js b/assets/js/src/Board.js index 6b6431fa..dede3e2b 100644 --- a/assets/js/src/Board.js +++ b/assets/js/src/Board.js @@ -1,6 +1,7 @@ function Board(app) { this.app = app; this.checkInterval = null; + this.savingInProgress = false; } Board.prototype.execute = function() { @@ -42,8 +43,7 @@ Board.prototype.reloadFilters = function(search) { }; Board.prototype.check = function() { - if (this.app.isVisible()) { - + if (this.app.isVisible() && ! this.savingInProgress) { var self = this; this.app.showLoadingIcon(); @@ -59,7 +59,9 @@ Board.prototype.check = function() { }; Board.prototype.save = function(taskId, columnId, position, swimlaneId) { + var self = this; this.app.showLoadingIcon(); + this.savingInProgress = true; $.ajax({ cache: false, @@ -73,8 +75,14 @@ Board.prototype.save = function(taskId, columnId, position, swimlaneId) { "swimlane_id": swimlaneId, "position": position }), - success: this.refresh.bind(this), - error: this.app.hideLoadingIcon.bind(this) + success: function(data) { + self.refresh(data); + this.savingInProgress = false; + }, + error: function() { + self.app.hideLoadingIcon(); + this.savingInProgress = false; + } }); }; -- cgit v1.2.3