Commit 669c25d0 authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Added default focus for alerts, in manner, that prevents the user from loosing data.

parent 66b36908
......@@ -29,7 +29,7 @@ var QfqNS = QfqNS || {};
event.preventDefault();
var alert = new n.Alert("Do you want to delete the file?",
"warning",
[{label: "OK", eventName: "ok"}, {label: "Cancel", eventName: "cancel"}]);
[{label: "OK", eventName: "ok"}, {label: "Cancel", eventName: "cancel", focus: true}]);
alert.on('alert.ok', function () {
this.performFileDelete(event);
}.bind(this));
......
......@@ -288,7 +288,7 @@ var QfqNS = QfqNS || {};
this.lastButtonPress = "close";
if (this.form.getFormChanged()) {
var alert = new n.Alert("You have unsaved changes. Do you want to close?", "warning",
[{label: "Yes", eventName: "ok"}, {label: "No", eventName: "no"}, {
[{label: "Yes", eventName: "ok"}, {label: "No", eventName: "no", focus: true}, {
label: "Save & Close",
eventName: "save"
}]);
......@@ -339,7 +339,7 @@ var QfqNS = QfqNS || {};
var alert = new n.Alert("You have unsaved changes. Do you want to close?", "warning",
[
{label: "Yes", eventName: "ok"},
{label: "No", eventName: "cancel"},
{label: "No", eventName: "cancel", focus: true},
{label: "Save & Close", eventName: "save"}
]);
var that = this;
......@@ -367,7 +367,7 @@ var QfqNS = QfqNS || {};
var alert = new n.Alert("Do you really want to delete the record?", "warning",
[
{label: "Yes", eventName: "ok"},
{label: "No", eventName: "cancel"}
{label: "No", eventName: "cancel", focus: true}
]);
var that = this;
alert.on('alert.ok', function () {
......
......@@ -43,7 +43,7 @@ var QfqNS = QfqNS || {};
var alert = new n.Alert("Do you really want to delete the record?", "warning",
[
{label: "Yes", eventName: "ok"},
{label: "No", eventName: "cancel"}
{label: "No", eventName: "cancel", focus: true}
]);
var that = this;
alert.on('alert.ok', function () {
......
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