From f74876eb3c3fbb7800ed07710da10c166add9b4f Mon Sep 17 00:00:00 2001 From: "John Molakvoæ (skjnldsv)" Date: Wed, 4 Mar 2020 13:51:40 +0100 Subject: Properly emit Viewer event on files and files_sharing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- apps/files/lib/Controller/ViewController.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'apps/files') 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']; -- cgit v1.2.3 From c4f1389289457afde5837d790a3d88a0e1c42f34 Mon Sep 17 00:00:00 2001 From: "John Molakvoæ (skjnldsv)" Date: Fri, 6 Mar 2020 15:44:42 +0100 Subject: Use dispatchTyped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- apps/files/lib/Controller/ViewController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/files') diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php index 015f34941de..70b878f43ad 100644 --- a/apps/files/lib/Controller/ViewController.php +++ b/apps/files/lib/Controller/ViewController.php @@ -284,7 +284,7 @@ class ViewController extends Controller { $this->eventDispatcher->dispatch(LoadSidebar::class, new LoadSidebar()); // Load Viewer scripts if (class_exists(LoadViewer::class)) { - $this->eventDispatcher->dispatch(LoadViewer::class, new LoadViewer()); + $this->eventDispatcher->dispatchTyped(new LoadViewer()); } $params = []; -- cgit v1.2.3