mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[FIX] web_responsive: Close Menu on Discard
This commit is contained in:
committed by
Sergey Shebanin
parent
37a3b4d3e1
commit
2ca39d3d41
@@ -114,6 +114,8 @@ odoo.define('web_responsive', function (require) {
|
||||
},
|
||||
|
||||
/**
|
||||
* Prevent the menu from being opened twice
|
||||
*
|
||||
* @override
|
||||
*/
|
||||
_onAppsMenuItemClicked: function (ev) {
|
||||
@@ -288,11 +290,14 @@ odoo.define('web_responsive', function (require) {
|
||||
BasicController.include({
|
||||
|
||||
/**
|
||||
* Close the AppDrawer if the data set is dirty and a discard dialog is opened
|
||||
*
|
||||
* @override
|
||||
*/
|
||||
canBeDiscarded: function (recordID) {
|
||||
if (this.model.isDirty(recordID || this.handle)) {
|
||||
$('.o_menu_apps .dropdown:has(.dropdown-menu.show) > a').dropdown('toggle');
|
||||
$('.o_menu_sections li.show .dropdown-toggle').dropdown('toggle');
|
||||
}
|
||||
return this._super.apply(this, arguments);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user