summaryrefslogtreecommitdiffstats
path: root/install/ui/src/freeipa/aci.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2014-01-16 17:26:25 +0100
committerPetr Vobornik <pvoborni@redhat.com>2014-03-20 10:02:31 +0100
commitc93dd068e475a46da7d58619c83db8832ff81ba1 (patch)
tree654312340720a7a58c1207d2d97c226cf0c8cf9a /install/ui/src/freeipa/aci.js
parent80324fcb23ba6559487ba29074b608dc2bbf4945 (diff)
downloadfreeipa-c93dd068e475a46da7d58619c83db8832ff81ba1.tar.gz
freeipa-c93dd068e475a46da7d58619c83db8832ff81ba1.tar.xz
freeipa-c93dd068e475a46da7d58619c83db8832ff81ba1.zip
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>
Diffstat (limited to 'install/ui/src/freeipa/aci.js')
-rw-r--r--install/ui/src/freeipa/aci.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/install/ui/src/freeipa/aci.js b/install/ui/src/freeipa/aci.js
index ce4eb0efa..7b0017856 100644
--- a/install/ui/src/freeipa/aci.js
+++ b/install/ui/src/freeipa/aci.js
@@ -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');
};