Browse Source

Merge pull request #28 from Callino/10.0-add_draggable_support-WP

[ADD] Added draggable support for preview window
10.0
Mathias Markl 6 years ago
committed by GitHub
parent
commit
6a2eb4ea85
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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() {
var self = this;
$('.tooltip').remove();
this.$modal.draggable({
handle: '.modal-header',
helper: false
});
this.replace(this.$modal.find(".modal-body")).then(function() {
self.$modal.modal('show');
self._opened.resolve();
@ -97,6 +101,10 @@ var PreviewDialog = Widget.extend({
}
},
close: function() {
var draggable = this.$modal.draggable( "instance" );
if (draggable) {
this.$modal.draggable("destroy");
}
this.$modal.modal('hide');
},
destroy: function(reason) {

Loading…
Cancel
Save