Commit 5a4b737c authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files
parent fbeba721
......@@ -27,9 +27,15 @@ var QfqNS = QfqNS || {};
n.FileDelete.prototype.buttonClicked = function (event) {
event.preventDefault();
var alert = new n.Alert("Do you want to delete the file?",
"warning",
[{label: "OK", eventName: "ok"}, {label: "Cancel", eventName: "cancel", focus: true}]);
var alert = new n.Alert({
message: "Do you want to delete the file?",
type: "warning",
modal: true,
buttons: [
{label: "OK", eventName: "ok"},
{label: "Cancel", eventName: "cancel", focus: true}
]
});
alert.on('alert.ok', function () {
this.performFileDelete(event);
}.bind(this));
......
......@@ -294,13 +294,16 @@ 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 save first?", "warning",
[
var alert = new n.Alert({
message: "You have unsaved changes. Do you want to save first?",
type: "warning",
modal: true,
buttons: [
{label: "Yes", eventName: "yes"},
{label: "No", eventName: "no", focus: true},
{
label: "Cancel", eventName: "cancel"
}]);
{label: "Cancel", eventName: "cancel"}
]
});
var that = this;
alert.on('alert.yes', function () {
that.submit();
......@@ -347,12 +350,17 @@ var QfqNS = QfqNS || {};
this.lastButtonPress = "new";
if (this.form.getFormChanged()) {
var alert = new n.Alert("You have unsaved changes. Do you want to save first?", "warning",
var alert = new n.Alert({
message: "You have unsaved changes. Do you want to save first?",
type: "warning",
modal: true,
buttons:
[
{label: "Yes", eventName: "yes", focus: true},
{label: "No", eventName: "no"},
{label: "Cancel", eventName: "cancel"}
]);
]
});
var that = this;
alert.on('alert.no', function () {
that.eventEmitter.emitEvent('qfqform.close-intentional', n.EventEmitter.makePayload(that, null));
......@@ -377,11 +385,15 @@ 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",
[
var alert = new n.Alert({
message: "Do you really want to delete the record?",
type: "warning",
modal: true,
buttons: [
{label: "Yes", eventName: "ok"},
{label: "No", eventName: "cancel", focus: true}
]);
]
});
var that = this;
alert.on('alert.ok', function () {
$.post(that.deleteUrl)
......
......@@ -40,11 +40,15 @@ var QfqNS = QfqNS || {};
}
var alert = new n.Alert("Do you really want to delete the record?", "warning",
[
var alert = new n.Alert({
message: "Do you really want to delete the record?",
type: "warning",
modal: true,
buttons: [
{label: "Yes", eventName: "ok"},
{label: "No", eventName: "cancel", focus: true}
]);
]
});
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