diff options
author | Endi S. Dewata <edewata@redhat.com> | 2011-04-19 11:53:00 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@people01.fedoraproject.org> | 2011-04-21 19:44:06 +0000 |
commit | d2be41dd1b69020b11cdd6ba66436424f3a0033a (patch) | |
tree | d88c09f5a0ef620df4319f2e564689f585299eb6 /install/ui/dns.js | |
parent | 3528b4eca3cf2519a6af5a43f6b321cbd8eea138 (diff) | |
download | freeipa-d2be41dd1b69020b11cdd6ba66436424f3a0033a.tar.gz freeipa-d2be41dd1b69020b11cdd6ba66436424f3a0033a.tar.xz freeipa-d2be41dd1b69020b11cdd6ba66436424f3a0033a.zip |
Standardized action panel buttons creation.
Action panel buttons are now created in facet's create_action_panel().
This is to allow a subclass to override and customize the buttons.
Diffstat (limited to 'install/ui/dns.js')
-rw-r--r-- | install/ui/dns.js | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/install/ui/dns.js b/install/ui/dns.js index 4debd368e..637b73446 100644 --- a/install/ui/dns.js +++ b/install/ui/dns.js @@ -299,6 +299,25 @@ IPA.records_facet = function (spec){ return pkey != that.pkey || record != that.record; }; + that.create_action_panel = function(container) { + + that.facet_create_action_panel(container); + + var buttons = $('.action-controls', container); + + $('<input/>', { + 'type': 'button', + 'name': 'remove', + 'value': IPA.messages.buttons.remove + }).appendTo(buttons); + + $('<input/>', { + 'type': 'button', + 'name': 'add', + 'value': IPA.messages.buttons.add + }).appendTo(buttons); + }; + function create_content(container) { $('<h1/>',{ @@ -337,24 +356,23 @@ IPA.records_facet = function (spec){ 'click': function(){refresh();} }).appendTo(control_span); - var action_panel_ul = $('.action-panel .entity-facet', that.container). - last(); - - var action_controls = $('<li/>',{ - "class":"action-controls"}).appendTo(action_panel_ul); - + var action_panel = that.get_action_panel(); - IPA.action_button({ + var button = $('input[name=remove]', action_panel); + that.remove_button = IPA.action_button({ label: IPA.messages.buttons.remove, icon: 'ui-icon-trash', click: function(){ delete_records(records_table); } - }).appendTo(action_controls); + }); + button.replaceWith(that.remove_button); - IPA.action_button({ + button = $('input[name=add]', action_panel); + that.add_button = IPA.action_button({ label: IPA.messages.buttons.add, icon: 'ui-icon-plus', click: add_click - }).appendTo(action_controls); + }); + button.replaceWith(that.add_button); div.append('<span class="records-buttons"></span>'); |