Etemplate: Cancel buttons do not trigger the change/close prompt

This commit is contained in:
nathangray
2020-06-24 10:37:57 -06:00
parent 74284afc07
commit 143be4dc98
4 changed files with 24 additions and 2 deletions

View File

@@ -288,7 +288,7 @@ var etemplate2 = /** @class */ (function () {
}
};
etemplate2.prototype._close_changed_prompt = function (e) {
if (!this.isDirty()) {
if (this._skip_close_prompt || !this.isDirty()) {
return;
}
// Cancel the event
@@ -296,6 +296,10 @@ var etemplate2 = /** @class */ (function () {
// Chrome requires returnValue to be set
e.returnValue = '';
};
etemplate2.prototype.skip_close_prompt = function (skip) {
if (skip === void 0) { skip = true; }
this._skip_close_prompt = skip;
};
/**
* Unbind our unload handler
*/