Eh
This commit is contained in:
@@ -10,7 +10,9 @@
|
||||
this.title = title || "Alert";
|
||||
this.type = type || Y2K.TYPE_INFO;
|
||||
this.message = message || "";
|
||||
this.options = options || {};
|
||||
this.options = Object.assign({
|
||||
closeOnBackdropClick: false
|
||||
}, options || {});
|
||||
this.isVisible = false;
|
||||
this.inputElement = null;
|
||||
this.overlayElement = null;
|
||||
@@ -101,6 +103,16 @@
|
||||
self.submit();
|
||||
});
|
||||
|
||||
this.overlayElement.addEventListener("click", function (event) {
|
||||
if (!self.options.closeOnBackdropClick) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.target === self.overlayElement) {
|
||||
self.close("backdrop");
|
||||
}
|
||||
});
|
||||
|
||||
if (this.inputElement) {
|
||||
this.inputElement.addEventListener("keydown", function (event) {
|
||||
if (event.key === "Enter") {
|
||||
|
||||
Reference in New Issue
Block a user