Browse Source

[ADD] Added draggable support for preview window

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

10
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) {
@ -124,4 +132,4 @@ PreviewDialog.createPreviewDialog = function (parent, url, mimetype, extension,
return PreviewDialog;
});
});
Loading…
Cancel
Save