diff options
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/js/filelist.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 5bdb1a8999d..c53fa4f3d66 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -473,7 +473,7 @@ * Displays the details view for the given file and * selects the given tab * - * @param {string} fileName file name for which to show details + * @param {string|OCA.Files.FileInfoModel} fileName file name or FileInfoModel for which to show details * @param {string} [tabId] optional tab id to select */ showDetailsView: function(fileName, tabId) { @@ -487,7 +487,7 @@ /** * Update the details view to display the given file * - * @param {string} fileName file name from the current list + * @param {string|OCA.Files.FileInfoModel} fileName file name from the current list or a FileInfoModel object * @param {boolean} [show=true] whether to open the sidebar if it was closed */ _updateDetailsView: function(fileName, show) { @@ -518,8 +518,8 @@ OC.Apps.showAppSidebar(this._detailsView.$el); } - if (_.isObject(fileName)) { - var model = new OCA.Files.FileInfoModel(fileName); + if (fileName instanceof OCA.Files.FileInfoModel) { + var model = fileName; } else { var $tr = this.findFileEl(fileName); var model = this.getModelForFile($tr); @@ -2025,7 +2025,7 @@ function updateInList(fileInfo) { self.updateRow(tr, fileInfo); - self._updateDetailsView(fileInfo.name, false); + self._updateDetailsView(fileInfo, false); } // TODO: too many nested blocks, move parts into functions |