]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #4051 fixed insert for case when priority is set to 0
authorCash Costello <cash.costello@gmail.com>
Fri, 4 Nov 2011 00:14:47 +0000 (20:14 -0400)
committerCash Costello <cash.costello@gmail.com>
Fri, 4 Nov 2011 00:14:47 +0000 (20:14 -0400)
js/classes/ElggPriorityList.js

index 831342f21406972a60c50f76c938a48138c53852..f7f91bb0fa7e4c995179dfed5a4ccb52e9b619e8 100644 (file)
@@ -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.