mirror of https://github.com/OCA/web.git
[FIX] web_responsive: AppDrawer Discard
parent
a4d55a8a0b
commit
482c614b26
|
@ -156,6 +156,7 @@ Contributors
|
|||
* Dennis Sluijk <d.sluijk@onestein.nl>
|
||||
* Sergio Teruel <sergio.teruel@tecnativa.com>
|
||||
* Alexandre Díaz <dev@redneboa.es>
|
||||
* Mathias Markl <mathias.markl@mukit.at>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
|
|
@ -278,6 +278,8 @@ odoo.define('web_responsive', function (require) {
|
|||
|
||||
Menu.include({
|
||||
events: _.extend({
|
||||
// Clicking on apps menu
|
||||
"click .o_menu_apps a[data-toggle=dropdown]": "_onAppsMenuClick",
|
||||
// Clicking a hamburger menu item should close the hamburger
|
||||
"click .o_menu_sections [role=menuitem]": "_hideMobileSubmenus",
|
||||
// Opening any dropdown in the navbar should hide the hamburger
|
||||
|
@ -324,6 +326,22 @@ odoo.define('web_responsive', function (require) {
|
|||
return this._super.apply(this, arguments);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check if Controller can be removed
|
||||
*/
|
||||
_onAppsMenuClick: function(event, checkedCanBeRemoved) {
|
||||
var action_manager = this.getParent().action_manager;
|
||||
var controller = action_manager.getCurrentController();
|
||||
if (controller && !checkedCanBeRemoved) {
|
||||
controller.widget.canBeRemoved().done(function () {
|
||||
$(event.currentTarget).trigger('click', [true]);
|
||||
$(event.currentTarget).off('.bs.dropdown');
|
||||
});
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
RelationalFields.FieldStatus.include({
|
||||
|
|
Loading…
Reference in New Issue