diff options
author | Cash Costello <cash.costello@gmail.com> | 2011-11-03 20:14:47 -0400 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2011-11-03 20:14:47 -0400 |
commit | 248f166dca51ea04e39560c19043a1c1a83d24d9 (patch) | |
tree | eb59c2d75b8015adf68ce039ac6211803be6a83a /js | |
parent | 3a75f6eda19e786d903cfda3a432e98a6c633f9d (diff) | |
download | elgg-248f166dca51ea04e39560c19043a1c1a83d24d9.tar.gz elgg-248f166dca51ea04e39560c19043a1c1a83d24d9.tar.bz2 |
Refs #4051 fixed insert for case when priority is set to 0
Diffstat (limited to 'js')
-rw-r--r-- | js/classes/ElggPriorityList.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/js/classes/ElggPriorityList.js b/js/classes/ElggPriorityList.js index 831342f21..f7f91bb0f 100644 --- a/js/classes/ElggPriorityList.js +++ b/js/classes/ElggPriorityList.js @@ -16,7 +16,10 @@ elgg.ElggPriorityList = function() { * @return {Void} */ elgg.ElggPriorityList.prototype.insert = function(obj, opt_priority) { - var priority = parseInt(opt_priority || 500, 10); + var priority = 500; + if (arguments.length == 2) { + priority = parseInt(opt_priority, 10); + } priority = Math.max(priority, 0); @@ -31,7 +34,7 @@ elgg.ElggPriorityList.prototype.insert = function(obj, opt_priority) { /** * Iterates through each element in order. * -* Unlike every, this ignores the return value of the callback. + * Unlike every, this ignores the return value of the callback. * * @param {Function} callback The callback function to pass each element through. See * Array.prototype.every() for details. |