mirror of https://github.com/OCA/web.git
commit
65e7d36865
|
@ -529,12 +529,31 @@ odoo.define('web_responsive', function (require) {
|
||||||
|
|
||||||
// DocumentViewer: Add support to maximize/minimize
|
// DocumentViewer: Add support to maximize/minimize
|
||||||
DocumentViewer.include({
|
DocumentViewer.include({
|
||||||
events: _.extend(DocumentViewer.prototype.events, {
|
// Widget 'keydown' and 'keyup' events are only dispatched when
|
||||||
|
// this.$el is active, but now the modal have buttons that can obtain
|
||||||
|
// the focus. For this reason we now listen core events, that are
|
||||||
|
// dispatched every time.
|
||||||
|
events: _.extend(_.omit(DocumentViewer.prototype.events, [
|
||||||
|
'keydown',
|
||||||
|
'keyup',
|
||||||
|
]), {
|
||||||
'click .o_maximize_btn': '_onClickMaximize',
|
'click .o_maximize_btn': '_onClickMaximize',
|
||||||
'click .o_minimize_btn': '_onClickMinimize',
|
'click .o_minimize_btn': '_onClickMinimize',
|
||||||
'shown.bs.modal': '_onShownModal',
|
'shown.bs.modal': '_onShownModal',
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
start: function () {
|
||||||
|
core.bus.on('keydown', this, this._onKeydown);
|
||||||
|
core.bus.on('keyup', this, this._onKeyUp);
|
||||||
|
return this._super.apply(this, arguments);
|
||||||
|
},
|
||||||
|
|
||||||
|
destroy: function () {
|
||||||
|
core.bus.off('keydown', this, this._onKeydown);
|
||||||
|
core.bus.off('keyup', this, this._onKeyUp);
|
||||||
|
this._super.apply(this, arguments);
|
||||||
|
},
|
||||||
|
|
||||||
_onShownModal: function () {
|
_onShownModal: function () {
|
||||||
// Disable auto-focus to allow to use controls in edit mode.
|
// Disable auto-focus to allow to use controls in edit mode.
|
||||||
// This only affects the active modal.
|
// This only affects the active modal.
|
||||||
|
|
Loading…
Reference in New Issue