diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2012-09-13 11:23:35 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2013-01-07 10:53:58 +0100 |
commit | c23dd23219d224de8844df07f7cf6564f8abc98f (patch) | |
tree | a428cb0b501308ac5c2e0dea4ee074c0bd0601f5 /install/ui/dialog.js | |
parent | 16663cb215fad4e20169a97231d94d3ee9c21adf (diff) | |
download | freeipa.git-c23dd23219d224de8844df07f7cf6564f8abc98f.tar.gz freeipa.git-c23dd23219d224de8844df07f7cf6564f8abc98f.tar.xz freeipa.git-c23dd23219d224de8844df07f7cf6564f8abc98f.zip |
Make confirm_dialog a base class for deleter dialog
https://fedorahosted.org/freeipa/ticket/3035
Diffstat (limited to 'install/ui/dialog.js')
-rw-r--r-- | install/ui/dialog.js | 38 |
1 files changed, 9 insertions, 29 deletions
diff --git a/install/ui/dialog.js b/install/ui/dialog.js index e3d3395f..172c4478 100644 --- a/install/ui/dialog.js +++ b/install/ui/dialog.js @@ -569,13 +569,17 @@ IPA.adder_dialog = function(spec) { IPA.deleter_dialog = function (spec) { spec = spec || {}; - spec.name = spec.name || 'deleter_dialog'; - - var that = IPA.dialog(spec); - that.title = spec.title || IPA.messages.buttons.remove; + spec.title = spec.title || IPA.messages.buttons.remove; + spec.name = spec.name || 'deleter_dialog'; + spec.message = spec.message || IPA.messages.search.delete_confirm; + spec.ok_label = spec.ok_label || IPA.messages.buttons.remove; + var that = IPA.confirm_dialog(spec); that.values = spec.values || []; + that.on_ok = spec.on_ok || function() { + that.execute(); + }; that.add_value = function(value) { that.values.push(value); @@ -588,7 +592,7 @@ IPA.deleter_dialog = function (spec) { that.create = function() { $('<p/>', { - 'text': IPA.messages.search.delete_confirm + 'text': that.message }).appendTo(that.container); var div = $('<div/>', { @@ -621,30 +625,6 @@ IPA.deleter_dialog = function (spec) { } }; - that.open = function(container) { - - that.create_button({ - name: 'remove', - label: IPA.messages.buttons.remove, - click: function() { - that.execute(); - } - }); - - that.create_button({ - name: 'cancel', - label: IPA.messages.buttons.cancel, - click: function() { - that.close(); - } - }); - - that.dialog_open(container); - }; - - that.execute = function() { - }; - that.deleter_dialog_create = that.create; return that; |