From 5a33143dc4d88eb2bc658cb28ca4189a1b773a56 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Thu, 3 Nov 2011 20:37:50 -0400 Subject: Fixes #4034 now using approach that exists in IE to find elements in an Array --- js/lib/elgglib.js | 4 ++-- 1 file 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; }; /** -- cgit v1.2.3