Browse Source

[IMP] Added draggable support to dialogs

pull/733/head
Wolfgang Pichler 7 years ago
parent
commit
d61bcef81b
  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
in the upper right corner (mimicking most windows managers).
It does also add draggable support to the dialogs.
Configuration
=============
@ -22,6 +23,7 @@ Contributors
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
* Holger Brunn <hbrunn@therp.nl>
* Siddharth Bhalgami <siddharth.bhalgami@gmail.com>
* Wolfgang Pichler <wpichler@callino.at>
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() {
var dialog = this.$modal.find('.modal-dialog');
dialog.addClass('dialog_full_screen');

Loading…
Cancel
Save