Fix issue with centering wide dialogs
This commit is contained in:
parent
2a6b597e55
commit
1d7b70b483
@ -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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user