Skip to content

Commit

Permalink
[js:core] fix Studio-42#3572 Useless backend request during elFinder.…
Browse files Browse the repository at this point in the history
…sync()

Rel. Studio-42#3568 Thanks, @magik092.
  • Loading branch information
nao-pon committed Jun 2, 2023
1 parent e9761f3 commit 03a945e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions js/elFinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -3059,12 +3059,23 @@ var elFinder = function(elm, opts, bootCallback) {
};
};

/**
* Sync Stopper
*
* @type Boolean
*/
this.syncStopper = false;

/**
* Sync content
*
* @return jQuery.Deferred
*/
this.sync = function(onlydir, polling) {
if (this.syncStopper) {
return $.Deferred().reject();
}
this.syncStopper = true;
this.autoSync('stop');
var self = this,
compare = function(){
Expand Down Expand Up @@ -3189,6 +3200,7 @@ var elFinder = function(elm, opts, bootCallback) {
return dfrd.resolve(diff);
})
.always(function() {
self.syncStopper = false;
self.autoSync();
});

Expand Down

0 comments on commit 03a945e

Please sign in to comment.