forked from Techsystech/web
[FIX] web_responsive: Remove auto-focus for the document viewer modal
parent
4d4dae1d97
commit
740683a9b5
|
@ -532,14 +532,15 @@ odoo.define('web_responsive', function (require) {
|
||||||
events: _.extend(DocumentViewer.prototype.events, {
|
events: _.extend(DocumentViewer.prototype.events, {
|
||||||
'click .o_maximize_btn': '_onClickMaximize',
|
'click .o_maximize_btn': '_onClickMaximize',
|
||||||
'click .o_minimize_btn': '_onClickMinimize',
|
'click .o_minimize_btn': '_onClickMinimize',
|
||||||
|
'shown.bs.modal': '_onShownModal',
|
||||||
}),
|
}),
|
||||||
|
|
||||||
start: function () {
|
_onShownModal: function () {
|
||||||
this.$btnMaximize = this.$('.o_maximize_btn');
|
// Disable auto-focus to allow to use controls in edit mode.
|
||||||
this.$btnMinimize = this.$('.o_minimize_btn');
|
// This only affects the active modal.
|
||||||
return this._super.apply(this, arguments);
|
// More info: https://stackoverflow.com/a/14795256
|
||||||
|
$(document).off('focusin.modal');
|
||||||
},
|
},
|
||||||
|
|
||||||
_onClickMaximize: function () {
|
_onClickMaximize: function () {
|
||||||
this.$el.removeClass('o_responsive_document_viewer');
|
this.$el.removeClass('o_responsive_document_viewer');
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue