mirror of https://github.com/OCA/web.git
[FIX] web_responsive: AppDrawer Discard
parent
0cb1e72d23
commit
eab63387b3
|
@ -156,6 +156,7 @@ Contributors
|
||||||
* Dennis Sluijk <d.sluijk@onestein.nl>
|
* Dennis Sluijk <d.sluijk@onestein.nl>
|
||||||
* Sergio Teruel <sergio.teruel@tecnativa.com>
|
* Sergio Teruel <sergio.teruel@tecnativa.com>
|
||||||
* Alexandre Díaz <dev@redneboa.es>
|
* Alexandre Díaz <dev@redneboa.es>
|
||||||
|
* Mathias Markl <mathias.markl@mukit.at>
|
||||||
|
|
||||||
Maintainers
|
Maintainers
|
||||||
~~~~~~~~~~~
|
~~~~~~~~~~~
|
||||||
|
|
|
@ -278,6 +278,8 @@ odoo.define('web_responsive', function (require) {
|
||||||
|
|
||||||
Menu.include({
|
Menu.include({
|
||||||
events: _.extend({
|
events: _.extend({
|
||||||
|
// Clicking on apps menu
|
||||||
|
"click .o_menu_apps a[data-toggle=dropdown]": "_onAppsMenuClick",
|
||||||
// Clicking a hamburger menu item should close the hamburger
|
// Clicking a hamburger menu item should close the hamburger
|
||||||
"click .o_menu_sections [role=menuitem]": "_hideMobileSubmenus",
|
"click .o_menu_sections [role=menuitem]": "_hideMobileSubmenus",
|
||||||
// Opening any dropdown in the navbar should hide the hamburger
|
// 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);
|
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({
|
RelationalFields.FieldStatus.include({
|
||||||
|
|
Loading…
Reference in New Issue