summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2020-03-13 11:55:52 +0100
committerGitHub <noreply@github.com>2020-03-13 11:55:52 +0100
commit97e7fdb6c68b854317db4235093174d45973c17d (patch)
treec7bf6266c6e0095fcd783d6cd4e56583198ec87f /apps/files
parentcbdff5c816c4087d60036bbdfd5a3f6d4c19b670 (diff)
parentc4f1389289457afde5837d790a3d88a0e1c42f34 (diff)
downloadnextcloud-server-97e7fdb6c68b854317db4235093174d45973c17d.tar.gz
nextcloud-server-97e7fdb6c68b854317db4235093174d45973c17d.zip
Merge pull request #19897 from nextcloud/backport/19777/stable18
[stable18] Properly emit Viewer event on files and files_sharing
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..70b878f43ad 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->dispatchTyped(new LoadViewer());
+ }
$params = [];
$params['usedSpacePercent'] = (int) $storageInfo['relative'];