diff options
author | Pavel Vomacka <pvomacka@redhat.com> | 2017-02-27 18:12:29 +0100 |
---|---|---|
committer | Tomas Krizek <tkrizek@redhat.com> | 2017-03-08 10:14:21 +0100 |
commit | d3700275c1b63aeeab13c7dd9e09249bc2c8e4d7 (patch) | |
tree | 595d0ae881a1d58d4b5181c218be31e95b1ff589 | |
parent | fba318b83337b71ccb3421690071a130171fbdfe (diff) | |
download | freeipa-d3700275c1b63aeeab13c7dd9e09249bc2c8e4d7.tar.gz freeipa-d3700275c1b63aeeab13c7dd9e09249bc2c8e4d7.tar.xz freeipa-d3700275c1b63aeeab13c7dd9e09249bc2c8e4d7.zip |
WebUI: Add Custom command multivalued adder dialog
Adder dialog which is used along with custom_command_multivalued_widget.
It behaivor of confirm dialog and adds fields which are necessary.
Part of: https://fedorahosted.org/freeipa/ticket/6601
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
-rw-r--r-- | install/ui/src/freeipa/dialog.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/install/ui/src/freeipa/dialog.js b/install/ui/src/freeipa/dialog.js index 8552e767d..5150527df 100644 --- a/install/ui/src/freeipa/dialog.js +++ b/install/ui/src/freeipa/dialog.js @@ -1451,6 +1451,40 @@ IPA.confirm_dialog = function(spec) { return that; }; +/** + * Custom command multivalued dialog + * + * Combines confirmation dialog which could be reopen after unsucessful command + * call. It also allows to define fields and widgets in the dialog. + * + * Acceptation is done by clicking on 'Add' button or hitting 'ENTER' key, + * refusal by clicking on 'Cancel' button or hitting 'ESCAPE' key. + * + * @class + * @extends IPA.form_dialog + */ +IPA.custom_command_multivalued_dialog = function(spec) { + spec = spec || {}; + + /** + * Name of confirmation button, by default set to 'Add'. + * @param {String} ok_label + */ + spec.ok_label = spec.ok_label || '@i18n:buttons.add'; + + var that = IPA.form_dialog(spec); + + that.close = function() { + that.dialog_close(); + }; + + that.on_confirm = function() { + if (that.on_ok) that.on_ok(); + }; + + return that; +}; + /** * |