3
0
Fork 0

[FIX] web_responsive: Remove auto-focus for the document viewer modal

12.0
Alexandre Díaz 2020-01-19 22:18:51 +01:00
parent 4d4dae1d97
commit 740683a9b5
1 changed files with 6 additions and 5 deletions

View File

@ -532,14 +532,15 @@ odoo.define('web_responsive', function (require) {
events: _.extend(DocumentViewer.prototype.events, {
'click .o_maximize_btn': '_onClickMaximize',
'click .o_minimize_btn': '_onClickMinimize',
'shown.bs.modal': '_onShownModal',
}),
start: function () {
this.$btnMaximize = this.$('.o_maximize_btn');
this.$btnMinimize = this.$('.o_minimize_btn');
return this._super.apply(this, arguments);
_onShownModal: function () {
// Disable auto-focus to allow to use controls in edit mode.
// This only affects the active modal.
// More info: https://stackoverflow.com/a/14795256
$(document).off('focusin.modal');
},
_onClickMaximize: function () {
this.$el.removeClass('o_responsive_document_viewer');
},