optional param for the mapping function
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 22 Feb 2006 19:38:35 +0000 (19:38 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 22 Feb 2006 19:38:35 +0000 (19:38 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3166 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/util/functional.js

index 84a74ce..812bbef 100644 (file)
@@ -45,9 +45,9 @@ util.functional.find_object = function(obj,f) {
 }
 
 util.functional.map_list = function(list,f) {
-       var new_list = [];
+       var new_list = []; var idx = 0;
        for (var i in list) {
-               new_list.push( f( list[i] ) );
+               new_list.push( f( list[i], idx++ ) );
        }
        return new_list;
 }