Skip to content

Commit

Permalink
refresh folder items / item preview feature #215
Browse files Browse the repository at this point in the history
  • Loading branch information
psolom committed Aug 7, 2017
1 parent f49243a commit 4974619
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
</div>
<div class="buttons-panel">
<div class="button-group navigate-controls">
<button class="btn-nav-level-up no-label" type="button" data-bind="click: headerModel.goParent, attr: {title: localizeGUI() ? lg().go_level_up : null}">
<button class="btn-nav-level-up no-label" type="button" data-bind="click: headerModel.navLevelUp, attr: {title: localizeGUI() ? lg().go_level_up : null}">
<span>&nbsp;</span>
</button>
<button class="btn-nav-home no-label" type="button" data-bind="click: headerModel.goHome, attr: {title: localizeGUI() ? lg().go_home : null}">
<button class="btn-nav-home no-label" type="button" data-bind="click: headerModel.navHome, attr: {title: localizeGUI() ? lg().go_home : null}">
<span>&nbsp;</span>
</button>
<button class="btn-nav-refresh no-label" type="button" data-bind="click: headerModel.refreshFolder, attr: {title: localizeGUI() ? lg().go_refresh : null}">
<button class="btn-nav-refresh no-label" type="button" data-bind="click: headerModel.navRefresh, attr: {title: localizeGUI() ? lg().go_refresh : null}">
<span>&nbsp;</span>
</button>
</div>
Expand Down Expand Up @@ -223,7 +223,7 @@
<div class="fm-preview" data-bind="with: previewModel">
<div class="fm-preview-toolbar">
<form id="fm-js-preview-toolbar">
<button class="btn-file-preview-close" type="button" data-bind="event: {click: function(data, event) {$root.headerModel.goParent()}}">
<button class="btn-file-preview-close" type="button" data-bind="event: {click: function(data, event) {$root.headerModel.navLevelUp()}}">
<span data-bind="text: $root.lg().parentfolder"></span>
</button>
<!-- ko if: buttonVisibility('select') -->
Expand Down
13 changes: 11 additions & 2 deletions scripts/filemanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -1850,12 +1850,12 @@ $.richFilemanagerPlugin = function(element, pluginOptions)
fm.log("CLOSE button is clicked");
};

this.goHome = function() {
this.navHome = function() {
model.previewFile(false);
model.itemsModel.loadList(fileRoot);
};

this.goParent = function() {
this.navLevelUp = function() {
var parentFolder = model.previewFile()
? getDirname(model.previewModel.rdo().id)
: getParentDirname(model.currentPath());
Expand All @@ -1869,6 +1869,15 @@ $.richFilemanagerPlugin = function(element, pluginOptions)
}
};

this.navRefresh = function() {
if(model.previewFile()) {
model.previewFile(false);
model.previewFile(true);
} else {
model.itemsModel.loadList(model.currentPath());
}
};

this.displayGrid = function() {
model.viewMode('grid');
model.previewFile(false);
Expand Down

0 comments on commit 4974619

Please sign in to comment.