Commit 80e833be authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Adjusted code to cope with new Alert.js.

parent 2bd24d2b
......@@ -27,7 +27,9 @@ var QfqNS = QfqNS || {};
n.FileDelete.prototype.buttonClicked = function (event) {
event.preventDefault();
var alert = new n.Alert("Do you want to delete the file?", "warning", "okcancel");
var alert = new n.Alert("Do you want to delete the file?",
"warning",
[{label: "OK", eventName: "ok"}, {label: "Cancel", eventName: "cancel"}]);
alert.on('alert.ok', function () {
this.performFileDelete(event);
}.bind(this));
......
......@@ -93,7 +93,6 @@ var QfqNS = QfqNS || {};
};
/**
*
* @private
......@@ -291,7 +290,11 @@ var QfqNS = QfqNS || {};
n.QfqForm.prototype.handleCloseClick = function () {
this.lastButtonPress = "close";
if (this.form.getFormChanged()) {
var alert = new n.Alert("You have unsaved changes. Do you want to close?", "warning", "yesnosave");
var alert = new n.Alert("You have unsaved changes. Do you want to close?", "warning",
[{label: "Yes", eventName: "ok"}, {label: "No", eventName: "no"}, {
label: "Save & Close",
eventName: "save"
}]);
var that = this;
alert.on('alert.save', function () {
that.submit();
......@@ -333,7 +336,12 @@ var QfqNS = QfqNS || {};
this.lastButtonPress = "new";
if (this.form.getFormChanged()) {
var alert = new n.Alert("You have unsaved changes. Do you want to close?", "warning", "yesnosave");
var alert = new n.Alert("You have unsaved changes. Do you want to close?", "warning",
[
{label: "Yes", eventName: "ok"},
{label: "No", eventName: "cancel"},
{label: "Save & Close", eventName: "save"}
]);
var that = this;
alert.on('alert.save', function () {
that.submit();
......@@ -356,7 +364,11 @@ var QfqNS = QfqNS || {};
n.QfqForm.prototype.handleDeleteClick = function () {
this.lastButtonPress = "delete";
n.Log.debug("delete click");
var alert = new n.Alert("Do you really want to delete the record?", "warning", "yesno");
var alert = new n.Alert("Do you really want to delete the record?", "warning",
[
{label: "Yes", eventName: "ok"},
{label: "No", eventName: "cancel"}
]);
var that = this;
alert.on('alert.ok', function () {
$.post(that.deleteUrl)
......
......@@ -40,7 +40,11 @@ var QfqNS = QfqNS || {};
}
var alert = new n.Alert("Do you really want to delete the record?", "warning", "yesno");
var alert = new n.Alert("Do you really want to delete the record?", "warning",
[
{label: "Yes", eventName: "ok"},
{label: "No", eventName: "cancel"}
]);
var that = this;
alert.on('alert.ok', function () {
$.post(that.deleteUrl + "?s=" + sip)
......
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