summaryrefslogtreecommitdiffstats
path: root/install/ui/facet.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2012-09-03 16:43:13 +0200
committerPetr Vobornik <pvoborni@redhat.com>2012-09-06 17:36:29 +0200
commit835c7859c5c31807b9f46cf79462459238571f5e (patch)
treef6c338cc023d95bb80057de46b71fbddedfcd561 /install/ui/facet.js
parenta01fbb91e88918ead456ae85e886e975f29dc1be (diff)
downloadfreeipa.git-835c7859c5c31807b9f46cf79462459238571f5e.tar.gz
freeipa.git-835c7859c5c31807b9f46cf79462459238571f5e.tar.xz
freeipa.git-835c7859c5c31807b9f46cf79462459238571f5e.zip
Update of confirmation of actions
This patch is changing confirmation of actions according to ticket #3035, see the ticket description. It does following changes: * Confirmation of update action was removed. * Action lists resets to first action (which is usually a NOP: '-- select action --') on change of displayed entry. * New confirmation dialog was implemented. It is used for action confirmation. It is used in IPA.action to replace the call of window.confirm(message). The old call is a modal window which blocks all JS functionality and has different style than other dialogs in Web UI. The new one has same design and doesn't block background operations. https://fedorahosted.org/freeipa/ticket/3035
Diffstat (limited to 'install/ui/facet.js')
-rw-r--r--install/ui/facet.js20
1 files changed, 17 insertions, 3 deletions
diff --git a/install/ui/facet.js b/install/ui/facet.js
index 0de08d3f..372022db 100644
--- a/install/ui/facet.js
+++ b/install/ui/facet.js
@@ -655,6 +655,7 @@ IPA.facet_header = function(spec) {
that.clear = function() {
that.load();
+ if (that.action_list) that.action_list.clear();
};
return that;
@@ -1300,6 +1301,10 @@ IPA.action = function(spec) {
that.needs_confirm = spec.needs_confirm !== undefined ? spec.needs_confirm : false;
that.confirm_msg = spec.confirm_msg || IPA.messages.actions.confirm;
+ that.confirm_dialog = spec.confirm_dialog !== undefined ? spec.confirm_dialog :
+ IPA.confirm_dialog;
+
+
that.execute_action = function(facet, on_success, on_error) {
@@ -1319,9 +1324,13 @@ IPA.action = function(spec) {
if (that.confirm_dialog) {
var dialog = IPA.build(that.confirm_dialog);
- confirmed = dialog.confirm(that.facet);
+ dialog.message = that.get_confirm_message(facet);
+ dialog.on_ok = function () {
+ that.execute_action(facet, on_success, on_error);
+ };
+ dialog.open();
} else {
- var msg = that.get_confirm_message();
+ var msg = that.get_confirm_message(facet);
confirmed = IPA.confirm(msg);
}
@@ -1331,7 +1340,7 @@ IPA.action = function(spec) {
that.execute_action(facet, on_success, on_error);
};
- that.get_confirm_message = function() {
+ that.get_confirm_message = function(facet) {
return that.confirm_msg;
};
@@ -2022,5 +2031,10 @@ IPA.action_list_widget = function(spec) {
that.action_select.update([first]);
};
+ that.clear = function() {
+
+ that.select_first_enabled();
+ };
+
return that;
}; \ No newline at end of file