mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
webui: better check for existing options in attributes_widgets
https://fedorahosted.org/freeipa/ticket/4079 Reviewed-By: Adam Misnyovszki <amisnyov@redhat.com> Reviewed-By: Petr Viktorin <pviktori@redhat.com>
This commit is contained in:
@@ -607,9 +607,7 @@ IPA.attributes_widget = function(spec) {
|
||||
var unmatched = [];
|
||||
|
||||
for (var i=0; i<that.values.length; i++) {
|
||||
var input = $('input[name="'+that.name+'"]'+
|
||||
'[value="'+that.values[i]+'"]', that.container);
|
||||
if (!input.length) {
|
||||
if (!that.has_option(that.values[i])) {
|
||||
unmatched.push(that.values[i]);
|
||||
}
|
||||
}
|
||||
@@ -620,6 +618,14 @@ IPA.attributes_widget = function(spec) {
|
||||
}
|
||||
};
|
||||
|
||||
that.has_option = function(value) {
|
||||
var o = that.options;
|
||||
for (var i=0, l=o.length; i<l; i++) {
|
||||
if (o[i].value === value) return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
that.show_undo = function() {
|
||||
$(that.undo_span).css('display', 'inline-block');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user