mirror of
https://github.com/JannisX11/blockbench.git
synced 2025-01-30 15:42:42 +08:00
Shapeless dialog fixes
This commit is contained in:
parent
799fea9c1e
commit
67d2c80eb5
@ -814,6 +814,7 @@ window.ShapelessDialog = class ShapelessDialog extends Dialog {
|
||||
super(id, options);
|
||||
|
||||
if (options.build) this.build = options.build;
|
||||
if (options.onClose) this.onClose = options.onClose;
|
||||
}
|
||||
close(button, event) {
|
||||
if (button == this.confirmIndex && typeof this.onConfirm == 'function') {
|
||||
@ -824,6 +825,10 @@ window.ShapelessDialog = class ShapelessDialog extends Dialog {
|
||||
let result = this.onCancel(event);
|
||||
if (result === false) return;
|
||||
}
|
||||
if (typeof this.onClose == 'function') {
|
||||
let result = this.onClose(event);
|
||||
if (result === false) return;
|
||||
}
|
||||
this.hide();
|
||||
}
|
||||
show() {
|
||||
@ -839,7 +844,7 @@ window.ShapelessDialog = class ShapelessDialog extends Dialog {
|
||||
}
|
||||
}
|
||||
delete() {
|
||||
this.object.remove()
|
||||
if (this.object) this.object.remove()
|
||||
}
|
||||
}
|
||||
|
||||
@ -939,7 +944,7 @@ window.MessageBox = class MessageBox extends Dialog {
|
||||
}
|
||||
}
|
||||
delete() {
|
||||
this.object.remove()
|
||||
if (this.object) this.object.remove()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user