mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
Popover menu: Fix JS widget instantiation, now done automatically but the UIBlock system
This commit is contained in:
@@ -56,7 +56,6 @@ $(function()
|
||||
// the constructor
|
||||
_create: function () {
|
||||
this.element.addClass('ibo-navigation-menu');
|
||||
$(this.js_selectors.user_menu).popover_menu({'toggler': this.js_selectors.user_menu_toggler});
|
||||
this._bindEvents();
|
||||
},
|
||||
// events bound via _bind are removed automatically
|
||||
|
||||
@@ -37,8 +37,7 @@ class PopoverMenu extends UIBlock
|
||||
// Overloaded constants
|
||||
public const BLOCK_CODE = 'ibo-popover-menu';
|
||||
public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/components/popover-menu/layout';
|
||||
// TODO 3.0.0: Fix crash when enabling the JS template
|
||||
//public const DEFAULT_JS_TEMPLATE_REL_PATH = 'base/components/popover-menu/layout';
|
||||
public const DEFAULT_JS_TEMPLATE_REL_PATH = 'base/components/popover-menu/layout';
|
||||
public const DEFAULT_JS_FILES_REL_PATH = [
|
||||
'js/components/popover-menu.js',
|
||||
];
|
||||
|
||||
@@ -49,11 +49,11 @@ class PopoverMenuFactory
|
||||
public static function MakeUserMenuForNavigationMenu()
|
||||
{
|
||||
$oMenu = new PopoverMenu('ibo-navigation-menu--user-menu');
|
||||
$oMenu->SetTogglerJSSelector('[data-role="ibo-navigation-menu--user-menu--toggler"]');
|
||||
|
||||
// Allowed portals
|
||||
$aAllowedPortalsItems = static::PrepareAllowedPortalsItemsForUserMenu();
|
||||
if(!empty($aAllowedPortalsItems))
|
||||
{
|
||||
if (!empty($aAllowedPortalsItems)) {
|
||||
$oMenu->AddSection('allowed_portals')
|
||||
->SetItems('allowed_portals', $aAllowedPortalsItems);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user