summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2011-06-16 15:24:48 -0400
committerEndi S. Dewata <edewata@redhat.com>2011-06-16 20:29:10 +0000
commitc03fab1095c4044ffb21b2b9962502886e6421b2 (patch)
treea50da661c1e1e4c30f8b0b6c058f5df729661fc3
parentc610a1738370e64aa8edf7c7043d3bc271ef5bfb (diff)
downloadfreeipa-c03fab1095c4044ffb21b2b9962502886e6421b2.tar.gz
freeipa-c03fab1095c4044ffb21b2b9962502886e6421b2.tar.xz
freeipa-c03fab1095c4044ffb21b2b9962502886e6421b2.zip
test dirty multivalue test the multivalue widgets for changes before showing the undo link. https://fedorahosted.org/freeipa/ticket/1337
-rw-r--r--install/ui/widget.js23
1 files changed, 22 insertions, 1 deletions
diff --git a/install/ui/widget.js b/install/ui/widget.js
index 445b949db..14a40a577 100644
--- a/install/ui/widget.js
+++ b/install/ui/widget.js
@@ -434,6 +434,27 @@ IPA.multivalued_text_widget = function(spec) {
}
};
+ that.super_test_dirty = that.test_dirty;
+
+ that.test_dirty = function(index){
+ if (index === undefined) {
+ return that.super_test_dirty();
+ }
+ var row = that.get_row(index);
+ var return_value = false;
+
+ $('input[name="'+that.name+'"]', row).each(function() {
+ var input = $(this);
+ if (input.is('.strikethrough')) return_value = true;
+ var value = input.val();
+
+ if (value !== that.values[index]){
+ return_value = true;
+ }
+ });
+ return return_value;
+ };
+
that.set_dirty = function(dirty, index) {
that.widget_set_dirty(dirty);
if (that.undo) {
@@ -589,7 +610,7 @@ IPA.multivalued_text_widget = function(spec) {
var index = that.row_index(row);
// uncross removed value
input.removeClass('strikethrough');
- that.set_dirty(true, index);
+ that.set_dirty( that.test_dirty(index), index);
if (that.undo) {
if (index < that.values.length) {
remove_link.css('display', 'inline');