diff options
author | Endi S. Dewata <edewata@redhat.com> | 2011-05-26 17:57:39 -0500 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2011-05-27 13:06:57 -0400 |
commit | aa29a8a769c62b07cc4e6d82fc79846505cc9fa3 (patch) | |
tree | 2131098b113c2bfecf1830feff0c08b3b2d1aabc /install/ui/associate.js | |
parent | 17c3f9e84efcbeb3b5ae1de83d799974de3bb078 (diff) | |
download | freeipa.git-aa29a8a769c62b07cc4e6d82fc79846505cc9fa3.tar.gz freeipa.git-aa29a8a769c62b07cc4e6d82fc79846505cc9fa3.tar.xz freeipa.git-aa29a8a769c62b07cc4e6d82fc79846505cc9fa3.zip |
Added Update and Reset buttons into Dirty dialog.
The Dirty dialogs have been combined into IPA.dirty_dialog. It
provides the Update and Reset buttons with customizable callback.
Previously the widget's dirty status is computed by comparing the
old values with the new values. This method is sometimes inaccurate,
so the is_dirty() method has been modified to simply return a flag
which is set to true if the widget is changed.
Ticket #896.
Diffstat (limited to 'install/ui/associate.js')
-rw-r--r-- | install/ui/associate.js | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/install/ui/associate.js b/install/ui/associate.js index 3ba510f1..5eb84260 100644 --- a/install/ui/associate.js +++ b/install/ui/associate.js @@ -348,7 +348,6 @@ IPA.association_table_widget = function (spec) { that.create = function(container) { - var entity = IPA.get_entity(that.entity_name); var column; // create a column if none defined @@ -395,21 +394,6 @@ IPA.association_table_widget = function (spec) { that.table_setup(container); - var dialog = IPA.dialog({ - title: IPA.messages.dialogs.dirty_title, - width: '20em' - }); - - dialog.create = function() { - dialog.container.append(IPA.messages.dialogs.dirty_message); - }; - - dialog.add_button(IPA.messages.buttons.ok, function() { - dialog.close(); - }); - - dialog.init(); - var entity = IPA.get_entity(that.entity_name); var facet_name = IPA.current_facet(entity); var facet = entity.get_facet(facet_name); @@ -424,7 +408,17 @@ IPA.association_table_widget = function (spec) { } if (facet.is_dirty()) { + var dialog = IPA.dirty_dialog({ + facet: facet + }); + + dialog.callback = function() { + that.show_remove_dialog(); + }; + + dialog.init(); dialog.open(that.container); + } else { that.show_remove_dialog(); } @@ -443,7 +437,17 @@ IPA.association_table_widget = function (spec) { } if (facet.is_dirty()) { + var dialog = IPA.dirty_dialog({ + facet: facet + }); + + dialog.callback = function() { + that.show_add_dialog(); + }; + + dialog.init(); dialog.open(that.container); + } else { that.show_add_dialog(); } @@ -809,11 +813,6 @@ IPA.association_facet = function (spec) { that.table.init(); }; - that.is_dirty = function() { - var pkey = $.bbq.getState(that.entity_name+'-pkey'); - return pkey != that.pkey; - }; - that.create_header = function(container) { that.facet_create_header(container); |