aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-03-04 13:51:40 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2020-03-11 09:28:27 +0100
commit92a6530c0f8bf50e94a0b5d23e3f334ac76a2941 (patch)
tree55f16ca60661fd6266668162712ba3d5bda4a7de /apps/files
parent6c968fe77db0ef96e16b103f47e318531f3d33be (diff)
downloadnextcloud-server-92a6530c0f8bf50e94a0b5d23e3f334ac76a2941.tar.gz
nextcloud-server-92a6530c0f8bf50e94a0b5d23e3f334ac76a2941.zip
Properly emit Viewer event on files and files_sharing
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/lib/Controller/ViewController.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php
index 688db41f8b0..015f34941de 100644
--- a/apps/files/lib/Controller/ViewController.php
+++ b/apps/files/lib/Controller/ViewController.php
@@ -39,6 +39,7 @@ namespace OCA\Files\Controller;
use OCA\Files\Activity\Helper;
use OCA\Files\Event\LoadAdditionalScriptsEvent;
use OCA\Files\Event\LoadSidebar;
+use OCA\Viewer\Event\LoadViewer;
use OCP\App\IAppManager;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\ContentSecurityPolicy;
@@ -281,6 +282,10 @@ class ViewController extends Controller {
$this->eventDispatcher->dispatch(LoadAdditionalScriptsEvent::class, $event);
$this->eventDispatcher->dispatch(LoadSidebar::class, new LoadSidebar());
+ // Load Viewer scripts
+ if (class_exists(LoadViewer::class)) {
+ $this->eventDispatcher->dispatch(LoadViewer::class, new LoadViewer());
+ }
$params = [];
$params['usedSpacePercent'] = (int) $storageInfo['relative'];