From 7f91e0284f4520a64f09e125bf50b19388f1a73a Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 20 Dec 2014 21:54:29 -0800 Subject: [PATCH] Cleanup file browser, added loading indicator --- src/UI/AddSeries/RootFolders/RootFolderLayout.js | 2 +- .../DownloadClient/Edit/DownloadClientEditView.js | 2 +- src/UI/Shared/FileBrowser/FileBrowserLayout.js | 12 +++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/UI/AddSeries/RootFolders/RootFolderLayout.js b/src/UI/AddSeries/RootFolders/RootFolderLayout.js index a313e1bd5..c64531367 100644 --- a/src/UI/AddSeries/RootFolders/RootFolderLayout.js +++ b/src/UI/AddSeries/RootFolders/RootFolderLayout.js @@ -42,7 +42,7 @@ define( this._showCurrentDirs(); } - this.ui.pathInput.fileBrowser({ showFiles: true, showLastModified: true }); + this.ui.pathInput.fileBrowser(); }, _onFolderSelected: function (options) { diff --git a/src/UI/Settings/DownloadClient/Edit/DownloadClientEditView.js b/src/UI/Settings/DownloadClient/Edit/DownloadClientEditView.js index 5bc9a08d7..26d16815f 100644 --- a/src/UI/Settings/DownloadClient/Edit/DownloadClientEditView.js +++ b/src/UI/Settings/DownloadClient/Edit/DownloadClientEditView.js @@ -39,7 +39,7 @@ define([ this.ui.modalBody.addClass('modal-overflow'); } - this.ui.path.fileBrowser({ showFiles: true }); + this.ui.path.fileBrowser(); }, _onAfterSave: function () { diff --git a/src/UI/Shared/FileBrowser/FileBrowserLayout.js b/src/UI/Shared/FileBrowser/FileBrowserLayout.js index 0eb9813b0..988a7c57b 100644 --- a/src/UI/Shared/FileBrowser/FileBrowserLayout.js +++ b/src/UI/Shared/FileBrowser/FileBrowserLayout.js @@ -35,7 +35,8 @@ define( }, ui: { - path: '.x-path' + path : '.x-path', + indicator : '.x-indicator' }, events: { @@ -53,17 +54,15 @@ define( this.input = options.input; this._setColumns(); - this._fetchCollection(this.input.val()); this.listenTo(this.collection, 'sync', this._showGrid); this.listenTo(this.collection, 'filebrowser:folderselected', this._rowSelected); }, onRender: function () { this.browser.show(new LoadingView()); - }, - - onShow: function () { this.ui.path.directoryAutoComplete(); + + this._fetchCollection(this.input.val()); this._updatePath(this.input.val()); }, @@ -103,6 +102,8 @@ define( }, _fetchCollection: function (path) { + this.ui.indicator.show(); + var data = { includeFiles : this.collection.showFiles }; @@ -117,6 +118,7 @@ define( }, _showGrid: function () { + this.ui.indicator.hide(); if (this.collection.models.length === 0) { this.browser.show(new EmptyView());