Shapeless dialog fixes

This commit is contained in:
JannisX11 2023-01-17 23:03:58 +01:00
parent 799fea9c1e
commit 67d2c80eb5

View File

@ -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()
}
}