diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-10-28 13:50:26 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-10-28 13:51:13 +0300 |
commit | db061cfc01e305e36224d06060d343cf47684e04 (patch) | |
tree | 29ce1cf26c2671cf6e7b86b5aed0f4bbcba5ef06 /src | |
parent | 48ab0b774104a544f1daefbc4ef088f6307a6605 (diff) |
Move viewer registration out of DOMContentLoaded
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/files.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/files.js b/src/files.js index 0ab1a7d32..c2b975f63 100644 --- a/src/files.js +++ b/src/files.js @@ -30,20 +30,22 @@ __webpack_public_path__ = OC.linkTo('text', 'js/') // eslint-disable-line registerFileCreate() -document.addEventListener('DOMContentLoaded', () => { - if (typeof OCA.Viewer === 'undefined') { - console.error('Viewer app is not installed') - registerFileActionFallback() - return - } +if (typeof OCA.Viewer !== 'undefined') { OCA.Viewer.registerHandler({ id: 'text', mimes: [...openMimetypesMarkdown, ...openMimetypesPlainText], component: FilesEditor, group: null }) - OC.Plugins.register('OCA.Files.SidebarPreviewManager', new PreviewPlugin()) +} +document.addEventListener('DOMContentLoaded', () => { + if (typeof OCA.Viewer === 'undefined') { + console.error('Viewer app is not installed') + registerFileActionFallback() + return + } + OC.Plugins.register('OCA.Files.SidebarPreviewManager', new PreviewPlugin()) }) OCA.Text = { |