diff options
Diffstat (limited to 'install/ui/jquery.ordered-map.js')
-rwxr-xr-x | install/ui/jquery.ordered-map.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/install/ui/jquery.ordered-map.js b/install/ui/jquery.ordered-map.js index 7c0f3fadc..64cad6e03 100755 --- a/install/ui/jquery.ordered-map.js +++ b/install/ui/jquery.ordered-map.js @@ -18,7 +18,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -jQuery.ordered_map = jQuery.fn.ordered_map = function() { +jQuery.ordered_map = jQuery.fn.ordered_map = function(map) { var that = {}; @@ -49,6 +49,18 @@ jQuery.ordered_map = jQuery.fn.ordered_map = function() { that.map[key] = value; }; + that.put_map = function(map) { + + if (typeof map !== 'object') return; + + for (name in map) { + + if (map.hasOwnProperty(name)) { + that.put(name, map[name]); + } + } + }; + that.remove = function(key) { var i = that.get_key_index(key); @@ -105,5 +117,8 @@ jQuery.ordered_map = jQuery.fn.ordered_map = function() { return new_map; }; + that.put_map(map); + + return that; }; |