Browse Source

[ADD] Added draggable support for preview window

pull/28/head
Wolfgang Pichler 6 years ago
parent
commit
3de8c93edd
  1. 8
      muk_web_preview/static/src/js/preview_dialog.js

8
muk_web_preview/static/src/js/preview_dialog.js

@ -57,6 +57,10 @@ var PreviewDialog = Widget.extend({
open: function() { open: function() {
var self = this; var self = this;
$('.tooltip').remove(); $('.tooltip').remove();
this.$modal.draggable({
handle: '.modal-header',
helper: false
});
this.replace(this.$modal.find(".modal-body")).then(function() { this.replace(this.$modal.find(".modal-body")).then(function() {
self.$modal.modal('show'); self.$modal.modal('show');
self._opened.resolve(); self._opened.resolve();
@ -97,6 +101,10 @@ var PreviewDialog = Widget.extend({
} }
}, },
close: function() { close: function() {
var draggable = this.$modal.draggable( "instance" );
if (draggable) {
this.$modal.draggable("destroy");
}
this.$modal.modal('hide'); this.$modal.modal('hide');
}, },
destroy: function(reason) { destroy: function(reason) {

Loading…
Cancel
Save