Skip to content

Commit

Permalink
improver renderer responsiveness while recursive search #315
Browse files Browse the repository at this point in the history
  • Loading branch information
psolom committed Apr 19, 2018
1 parent 46826ca commit 4b63e33
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/js/filemanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -2325,6 +2325,7 @@ $.richFilemanagerPlugin = function(element, pluginOptions)
searchOnTyping = !!config.search.typingDelay;

this.value = ko.observable('');
this.isRendered = ko.observable(false);

this.value.subscribe(function(oldValue) {
previousValue = oldValue;
Expand Down Expand Up @@ -2360,8 +2361,9 @@ $.richFilemanagerPlugin = function(element, pluginOptions)

this.clearInput = function () {
// reset search string
previousValue = '';
search_model.value('');
previousValue = search_model.value();
search_model.isRendered(false);
delayStack.removeTimer('search');
};

Expand Down Expand Up @@ -2411,6 +2413,7 @@ $.richFilemanagerPlugin = function(element, pluginOptions)

var items = model.itemsModel.createItems(resourceObjects);
model.itemsModel.setItemsList(items);
search_model.isRendered(true);
})
.load(function () {
return seekFolder(targetPath, searchString);
Expand All @@ -2430,6 +2433,7 @@ $.richFilemanagerPlugin = function(element, pluginOptions)
itemObject.cdo.hiddenBySearch = !matchByName;
itemObject.visible(visibility);
});
search_model.isRendered(true);
}
}

Expand Down Expand Up @@ -2566,7 +2570,7 @@ $.richFilemanagerPlugin = function(element, pluginOptions)
};

this.getLabel = ko.pureComputed(function() {
var label = model.searchModel.value() ? lg('search_results') : lg('current_folder');
var label = model.searchModel.isRendered() ? lg('search_results') : lg('current_folder');
return label + ': ';
}, this);

Expand Down
Loading

0 comments on commit 4b63e33

Please sign in to comment.