diff options
Diffstat (limited to 'install/ui/jquery.ordered-map.js')
-rwxr-xr-x | install/ui/jquery.ordered-map.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/install/ui/jquery.ordered-map.js b/install/ui/jquery.ordered-map.js index ea61b954..f30f8d13 100755 --- a/install/ui/jquery.ordered-map.js +++ b/install/ui/jquery.ordered-map.js @@ -44,7 +44,7 @@ jQuery.ordered_map = jQuery.fn.ordered_map = function() { that.remove = function(key) { - var i = that.keys.indexOf(key); + var i = that.get_key_index(key); if (i<0) return null; that.keys.splice(i, 1); @@ -63,5 +63,17 @@ jQuery.ordered_map = jQuery.fn.ordered_map = function() { that.length = that.keys.length; }; + that.get_key_index = function(key) { + return that.keys.indexOf(key); + }; + + that.get_key_by_index = function(index) { + return that.keys[index]; + }; + + that.get_value_by_index = function(index) { + return that.values[index]; + }; + return that; }; |