diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-02-28 18:09:30 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-03-01 16:10:42 +0300 |
commit | 1f2fa52843677445209789ce216d3f79383a98d6 (patch) | |
tree | 47db1bcc480c8286c38fd2beae41bf91a77c3da5 /js/documents.js | |
parent | e4d12ccb76a733050dae90522f3408dfdf3c1a44 (diff) |
Use proper fileList object when fetching the file model
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'js/documents.js')
-rw-r--r-- | js/documents.js | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/js/documents.js b/js/documents.js index 47b077c2..99b47424 100644 --- a/js/documents.js +++ b/js/documents.js @@ -923,16 +923,18 @@ var documentsMain = { }, getFileModel: function() { - parent.OCA.Files.App.fileList._updateDetailsView(documentsMain.fileName, false); - var fileModel = parent.OCA.Files.App.fileList.getModelForFile(documentsMain.fileName); - if (fileModel) { - documentsMain.fileModel = fileModel; - fileModel.on('change', function () { + if (documentsMain.getFileList()) { + documentsMain.getFileList()._updateDetailsView(documentsMain.fileName, false); + var fileModel = documentsMain.getFileList().getModelForFile(documentsMain.fileName); + if (fileModel) { + documentsMain.fileModel = fileModel; + fileModel.on('change', function () { + documentsMain.UI._addHeaderFileActions(); + }); documentsMain.UI._addHeaderFileActions(); - }); - documentsMain.UI._addHeaderFileActions(); - } else { - setTimeout(documentsMain.getFileModel, 500); + } else { + setTimeout(documentsMain.getFileModel, 500); + } } }, |