summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@owncloud.com>2015-09-16 16:19:13 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-10-23 15:25:07 +0200
commit4ac33ab26bc75cde5277f59b3a0f0b3713c05dab (patch)
treec58bcb55e6c7dfe932d51d667f3210fb0b444459 /apps
parent7afbf0f8c1eb67b3b5da8a71df3d7cbd7064d898 (diff)
downloadnextcloud-server-4ac33ab26bc75cde5277f59b3a0f0b3713c05dab.tar.gz
nextcloud-server-4ac33ab26bc75cde5277f59b3a0f0b3713c05dab.zip
Remove status indicator on modification
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/js/settings.js29
1 files changed, 21 insertions, 8 deletions
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js
index 5da34c52193..c4646d429f8 100644
--- a/apps/files_external/js/settings.js
+++ b/apps/files_external/js/settings.js
@@ -709,11 +709,12 @@ MountConfigListView.prototype = _.extend({
}
highlightInput($target);
var $tr = $target.closest('tr');
+ this.updateStatus($tr, null);
var timer = $tr.data('save-timer');
clearTimeout(timer);
timer = setTimeout(function() {
- self.saveStorageConfig($tr);
+ self.saveStorageConfig($tr, null, timer);
}, 2000);
$tr.data('save-timer', timer);
},
@@ -931,8 +932,9 @@ MountConfigListView.prototype = _.extend({
*
* @param $tr storage row
* @param Function callback callback to call after save
+ * @param concurrentTimer only update if the timer matches this
*/
- saveStorageConfig:function($tr, callback) {
+ saveStorageConfig:function($tr, callback, concurrentTimer) {
var self = this;
var storage = this.getStorageConfig($tr);
if (!storage.validate()) {
@@ -942,15 +944,23 @@ MountConfigListView.prototype = _.extend({
this.updateStatus($tr, StorageConfig.Status.IN_PROGRESS);
storage.save({
success: function(result) {
- self.updateStatus($tr, result.status);
- $tr.attr('data-id', result.id);
-
- if (_.isFunction(callback)) {
- callback(storage);
+ if (concurrentTimer === undefined
+ || $tr.data('save-timer') === concurrentTimer
+ ) {
+ self.updateStatus($tr, result.status);
+ $tr.attr('data-id', result.id);
+
+ if (_.isFunction(callback)) {
+ callback(storage);
+ }
}
},
error: function() {
- self.updateStatus($tr, StorageConfig.Status.ERROR);
+ if (concurrentTimer === undefined
+ || $tr.data('save-timer') === concurrentTimer
+ ) {
+ self.updateStatus($tr, StorageConfig.Status.ERROR);
+ }
}
});
},
@@ -989,6 +999,9 @@ MountConfigListView.prototype = _.extend({
var $statusSpan = $tr.find('.status span');
$statusSpan.removeClass('loading-small success indeterminate error');
switch (status) {
+ case null:
+ // remove status
+ break;
case StorageConfig.Status.IN_PROGRESS:
$statusSpan.addClass('loading-small');
break;