Browse Source

[IMP] Added draggable support to dialogs

pull/869/head
Wolfgang Pichler 7 years ago
committed by Pedro M. Baeza
parent
commit
d38ba72efc
  1. 2
      web_dialog_size/README.rst
  2. 16
      web_dialog_size/static/src/js/web_dialog_size.js

2
web_dialog_size/README.rst

@ -3,6 +3,7 @@ Expand Dialog
A module that lets the user expand/restore the dialog box size through a button A module that lets the user expand/restore the dialog box size through a button
in the upper right corner (mimicking most windows managers). in the upper right corner (mimicking most windows managers).
It does also add draggable support to the dialogs.
Configuration Configuration
============= =============
@ -22,6 +23,7 @@ Contributors
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com> * Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
* Holger Brunn <hbrunn@therp.nl> * Holger Brunn <hbrunn@therp.nl>
* Siddharth Bhalgami <siddharth.bhalgami@gmail.com> * Siddharth Bhalgami <siddharth.bhalgami@gmail.com>
* Wolfgang Pichler <wpichler@callino.at>
Maintainer Maintainer
---------- ----------

16
web_dialog_size/static/src/js/web_dialog_size.js

@ -22,6 +22,22 @@ Dialog.include({
}); });
}, },
open: function() {
var res = this._super.apply(this, arguments);
this.$modal.draggable({
handle: "div.modal-header",
});
return res;
},
close: function() {
var draggable = this.$modal.draggable( "instance" );
if (draggable)
this.$modal.draggable("destroy");
var res = this._super.apply(this, arguments);
return res;
},
_extending: function() { _extending: function() {
var dialog = this.$modal.find('.modal-dialog'); var dialog = this.$modal.find('.modal-dialog');
dialog.addClass('dialog_full_screen'); dialog.addClass('dialog_full_screen');

Loading…
Cancel
Save