mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[ADD] module web_dialog_size
New module that let the user expand a dialog box to the full screen width.
This commit is contained in:
committed by
Mantux11
parent
23cec05e3c
commit
2c1216c791
37
web_dialog_size/static/src/js/web_dialog_size.js
Normal file
37
web_dialog_size/static/src/js/web_dialog_size.js
Normal file
@@ -0,0 +1,37 @@
|
||||
openerp.web_dialog_size= function (instance) {
|
||||
|
||||
instance.web.Dialog = instance.web.Dialog.extend({
|
||||
|
||||
init_dialog: function () {
|
||||
var self = this;
|
||||
this._super();
|
||||
self.$dialog_box.find('.dialog_button_restore').addClass('dialog_button_hide');
|
||||
if (this.dialog_options.size !== 'large'){
|
||||
self.$dialog_box.find('.dialog_button_extend').addClass('dialog_button_hide');
|
||||
}
|
||||
else{
|
||||
self.$dialog_box.find('.dialog_button_extend').on('click', self._extending);
|
||||
self.$dialog_box.find('.dialog_button_restore').on('click', self._restore);
|
||||
}
|
||||
},
|
||||
|
||||
_extending: function() {
|
||||
var self = this;
|
||||
$(this).parents('.modal-dialog').addClass('dialog_full_screen');
|
||||
$(this).addClass('dialog_button_hide');
|
||||
|
||||
$(this).parents('.modal-dialog').find('.dialog_button_restore').removeClass('dialog_button_hide')
|
||||
},
|
||||
|
||||
_restore: function() {
|
||||
var self = this;
|
||||
$(this).parents('.modal-dialog').removeClass('dialog_full_screen');
|
||||
$(this).addClass('dialog_button_hide');
|
||||
|
||||
$(this).parents('.modal-dialog').find('.dialog_button_extend').removeClass('dialog_button_hide')
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user