Skip to content

Commit

Permalink
[js:core] fix sync() problem on ls at pre-upload
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-pon committed Apr 8, 2016
1 parent a210790 commit a88013f
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions js/elFinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2865,7 +2865,7 @@ elFinder.prototype = {
preventFail : true
})
.done(function(data) {
var existedArr;
var existedArr, cwdItems;
if (data) {
if (data.error) {
cancel();
Expand All @@ -2890,12 +2890,16 @@ elFinder.prototype = {
}
hashes = data.list;
}
exists = $.map(names, function(name){ return $.inArray(name.name, existed) !== -1 ? name : null ;});
if (target == fm.cwd().hash &&
$($.map(fm.files(), function(file) { return (file.phash == target) ? file.name : null; } ))
.filter(existed).length < 1
) {
fm.sync();
exists = $.map(names, function(name){
return $.inArray(name.name, existed) !== -1 ? name : null ;
});
if (existed.length && target == fm.cwd().hash) {
cwdItems = $.map(fm.files(), function(file) { return (file.phash == target) ? file.name : null; } );
if ($.map(existed, function(n) {
return cwdItems.indexOf(n) === -1? true : null;
}).length){
fm.sync();
}
}
}
}
Expand Down

0 comments on commit a88013f

Please sign in to comment.