Skip to content

Commit

Permalink
Need to handle the old OCA\Files_Sharing::loadAdditionalScripts event…
Browse files Browse the repository at this point in the history
… in some cases (#189)

Signed-off-by: Sebastien Marinier <seb@smarinier/net>
  • Loading branch information
smarinier authored Nov 27, 2023
1 parent c816bf9 commit 6a87eb9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public function register(IRegistrationContext $context): void {
LoadAdditionalScriptsEvent::class,
LoadAdditionalScripts::class
);

$container = $this->getContainer();
/** @var IEventDispatcher $eventDispatcher */
$eventDispatcher = $container->get(IEventDispatcher::class);
$eventDispatcher->addListener('OCA\Files_Sharing::loadAdditionalScripts', array('OCA\Files_MindMap\Listener\LoadAdditionalScripts','additionalScripts'));
}

public function boot(IBootContext $context): void {
Expand Down
3 changes: 3 additions & 0 deletions lib/Listener/LoadAdditionalScripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ public function handle(Event $event): void {
if (!($event instanceof LoadAdditionalScriptsEvent)) {
return;
}
self::additionalScripts();
}

public static function additionalScripts() {
Util::addStyle(Application::APPNAME, 'style');
Util::addScript(Application::APPNAME, 'jszip');
Util::addScript(Application::APPNAME, 'mindmap');
Expand Down

0 comments on commit 6a87eb9

Please sign in to comment.