mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
test dirty multivalue test the multivalue widgets for changes before showing the undo link. https://fedorahosted.org/freeipa/ticket/1337
This commit is contained in:
committed by
Endi S. Dewata
parent
c610a17383
commit
c03fab1095
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user