ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
trait.ilMMCloseOnClick.php
Go to the documentation of this file.
1 <?php
18 declare(strict_types=1);
19 
24 
29 trait ilMMCloseOnClick
30 {
31  protected function addDisengageDecorator(isItem $item): isItem
32  {
33  if (($item instanceof isParent || $item instanceof isInterchangeableItem) && $item->getParent()->serialize() === '') {
34  // always close MainBar when a link has been clicked
35  return $item->addComponentDecorator(static function (
38  if (!$c instanceof Link) {
39  return $c->withAdditionalOnLoadCode(fn ($id) => "$('#$id').click(function() {
40  il.UI.maincontrols.mainbar.disengageAll();
41  il.UI.maincontrols.mainbar.clearStates();
42  })");
43  }
44  return $c;
45  });
46  }
47 
48  return $item;
49  }
50 }
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addComponentDecorator(Closure $component_decorator)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23