mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
Popover menu: Refactor to remove the necessity of coupling JS and PHP code to instantiate it correctly
This commit is contained in:
@@ -134,9 +134,6 @@ $(function()
|
||||
this._ReformatDateTimes();
|
||||
this._PrepareEntriesSubmitConfirmationDialog();
|
||||
|
||||
// TODO 3.0.0: Modify PopoverMenu so we can pass it the ID of the block triggering the open/close
|
||||
//$(this.element).find(this.js_selectors.send_choices_picker).popover_menu({toggler: this.js_selectors.send_button});
|
||||
|
||||
this.element.trigger('ready.activity_panel.itop');
|
||||
},
|
||||
// events bound via _bind are removed automatically
|
||||
|
||||
@@ -100,11 +100,6 @@ $(function()
|
||||
this.element.find(this.js_selectors.menu_filter_hint_close).on('click', function (oEvent) {
|
||||
me._onFilterHintCloseClick(oEvent);
|
||||
});
|
||||
|
||||
// User info
|
||||
this.element.find(this.js_selectors.user_menu_toggler).on('click', function (oEvent) {
|
||||
me._onUserMenuTogglerClick(oEvent);
|
||||
});
|
||||
},
|
||||
|
||||
// Events callbacks
|
||||
@@ -195,20 +190,6 @@ $(function()
|
||||
SetUserPreference('navigation_menu.show_filter_hint', false, true);
|
||||
},
|
||||
|
||||
_onUserMenuTogglerClick: function(oEvent)
|
||||
{
|
||||
// Avoid anchor glitch
|
||||
oEvent.preventDefault();
|
||||
var oEventTarget = $(oEvent.target);
|
||||
var aEventTargetPos = oEventTarget.position();
|
||||
|
||||
$(this.js_selectors.user_menu_container).css({
|
||||
'top': (aEventTargetPos.top + parseInt(oEventTarget.css('marginTop'), 10) - $(this.js_selectors.user_menu).height()) + 'px',
|
||||
'left': (aEventTargetPos.left + parseInt(oEventTarget.css('marginLeft'), 10) + oEventTarget.width()) + 'px'
|
||||
});
|
||||
$(this.js_selectors.user_menu).popover_menu('togglePopup');
|
||||
},
|
||||
|
||||
// Methods
|
||||
_checkIfClickShouldCloseDrawer: function(oEvent)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user