diff --git a/js/interface/dialog.js b/js/interface/dialog.js index 71ca8af..176b53e 100644 --- a/js/interface/dialog.js +++ b/js/interface/dialog.js @@ -452,8 +452,6 @@ window.Dialog = class Dialog { handle: ".dialog_handle", containment: '#page_wrapper' }) - var x = Math.clamp((window.innerWidth-540)/2, 0, 2000) - jq_dialog.css('left', x+'px') jq_dialog.css('position', 'absolute') } return this; @@ -478,6 +476,10 @@ window.Dialog = class Dialog { if (this.width) { jq_dialog.css('width', this.width+'px'); } + if (this.draggable !== false) { + var x = Math.clamp((window.innerWidth-this.object.clientWidth)/2, 0, 2000) + jq_dialog.css('left', x+'px') + } if (!Blockbench.isTouch) { let first_focus = jq_dialog.find('.focusable_input').first(); if (first_focus) first_focus.trigger('focus');