diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-02-20 23:59:40 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-02-21 19:03:02 +0300 |
commit | 28e04624b3112b51e386f011f69dcb6da6066634 (patch) | |
tree | 5a32d47e3f210ec19cb6f816b5dd3e8c7595365b /js/documents.js | |
parent | b093c6f02493b80bed2e5d1b4eceacc64dd43b67 (diff) |
Properly check if fileList is available
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'js/documents.js')
-rw-r--r-- | js/documents.js | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/js/documents.js b/js/documents.js index 8e7525a7..73959970 100644 --- a/js/documents.js +++ b/js/documents.js @@ -168,6 +168,16 @@ var documentsMain = { return ocurl; }, + getFileList: function() { + if (parent.OCA.Files.App) { + return parent.OCA.Files.App.FileList; + } + if (parent.OCA.Files.FileList) { + return parent.OCA.Files.FileList; + } + return null; + }, + UI : { /* Editor wrapper HTML */ container : '<div id="mainContainer" class="claro">' + @@ -612,8 +622,8 @@ var documentsMain = { } } else if (msg.Values.Status === "Document_Loaded" ) { window.removeEventListener('message', editorInitListener, false); - if (parent.OCA.Files.App.fileList.reload) { - parent.OCA.Files.App.fileList.reload(); + if (documentsMain.getFileList()) { + documentsMain.getFileList().reload(); documentsMain.getFileModel(); } } @@ -838,8 +848,8 @@ var documentsMain = { } documentsMain.ready = true; - if (parent && parent.OCA.Files.App.fileList.reload) { - parent.OCA.Files.App.fileList.reload(); + if (parent && documentsMain.getFileList() !== null) { + documentsMain.getFileList().reload(); } }, |