Browse Source

[FIX] web_responsive: Close Menu on Discard

pull/1311/head
Mathias Markl 5 years ago
parent
commit
2e911c6b02
  1. 1
      web_responsive/readme/CONTRIBUTORS.rst
  2. 5
      web_responsive/static/src/js/web_responsive.js

1
web_responsive/readme/CONTRIBUTORS.rst

@ -3,3 +3,4 @@
* Dennis Sluijk <d.sluijk@onestein.nl>
* Sergio Teruel <sergio.teruel@tecnativa.com>
* Alexandre Díaz <dev@redneboa.es>
* Mathias Markl <mathias.markl@mukit.at>

5
web_responsive/static/src/js/web_responsive.js

@ -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);
},

Loading…
Cancel
Save