Commit c3a3609b authored by bbaer's avatar bbaer
Browse files

cleaning up old attempts

parent 00e4e5cb
...@@ -170,32 +170,6 @@ var QfqNS = QfqNS || {}; ...@@ -170,32 +170,6 @@ var QfqNS = QfqNS || {};
this.lockAcquired = true; this.lockAcquired = true;
}; };
n.QfqForm.prototype.handleUnload = function(e) {
var that = this;
var alert = new n.Alert({
message: "Do you want to save before leaving?",
type: "info",
buttons: [
{ label: "Yes", eventName: "yes" },
{ label: "No", eventName: "no" },
{ label: "Cancel", eventName: "cancel" }
]
});
alert.on('alert.yes', function() {
that.handleSaveClick();
that.releaseLock();
});
alert.on('alert.no', function() {
that.releaseLock();
});
alert.on('alert.cancel', function() {
return false;
});
e.preventDefault();
return null;
};
/** /**
* @public * @public
*/ */
......
...@@ -81,7 +81,7 @@ var QfqNS = QfqNS || {}; ...@@ -81,7 +81,7 @@ var QfqNS = QfqNS || {};
// We have to use 'pagehide'. 'unload' is too late and the ajax request is lost. // We have to use 'pagehide'. 'unload' is too late and the ajax request is lost.
window.addEventListener("pagehide", (function (that) { window.addEventListener("pagehide", (function (that) {
return function () { return function () {
that.qfqForm.releaseLock(); that.qfqForm.releaseLock(true);
}; };
})(this)); })(this));
} catch (e) { } catch (e) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment