aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-11-03 20:37:50 -0400
committerCash Costello <cash.costello@gmail.com>2011-11-03 20:37:50 -0400
commit5a33143dc4d88eb2bc658cb28ca4189a1b773a56 (patch)
tree7bbd9d0c8f847288ccd984cf773ec9e044ecee60
parent065dfb7a15747291aca90aa22752ffc2d7b7328e (diff)
downloadelgg-5a33143dc4d88eb2bc658cb28ca4189a1b773a56.tar.gz
elgg-5a33143dc4d88eb2bc658cb28ca4189a1b773a56.tar.bz2
Fixes #4034 now using approach that exists in IE to find elements in an Array
-rw-r--r--js/lib/elgglib.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/js/lib/elgglib.js b/js/lib/elgglib.js
index d963a62be..85251c1e8 100644
--- a/js/lib/elgglib.js
+++ b/js/lib/elgglib.js
@@ -535,7 +535,7 @@ elgg.push_to_object_array = function(object, parent, value) {
object[parent] = []
}
- if (object[parent].indexOf(value) < 0) {
+ if ($.inArray(value, object[parent]) < 0) {
return object[parent].push(value);
}
@@ -553,7 +553,7 @@ elgg.is_in_object_array = function(object, parent, value) {
elgg.assertTypeOf('object', object);
elgg.assertTypeOf('string', parent);
- return typeof(object[parent]) != 'undefined' && object[parent].indexOf(value) >= 0;
+ return typeof(object[parent]) != 'undefined' && $.inArray(value, object[parent]) >= 0;
};
/**