From 914d92f1352fd722900b22691f25074cbba7edb8 Mon Sep 17 00:00:00 2001 From: rolux Date: Sat, 29 Dec 2012 15:57:01 +0100 Subject: [PATCH] properly cache Ox.UI.getImageURL --- source/Ox.UI/Ox.UI.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/Ox.UI/Ox.UI.js b/source/Ox.UI/Ox.UI.js index 3ffc38b1..0c6e4850 100644 --- a/source/Ox.UI/Ox.UI.js +++ b/source/Ox.UI/Ox.UI.js @@ -327,7 +327,7 @@ Ox.load.UI = function(options, callback) { color Color name or RGB values theme Theme name @*/ - Ox.UI.getImageURL = function(name, color, theme) { + Ox.UI.getImageURL = Ox.cache(function(name, color, theme) { var colorName, image = images[name], themeData, @@ -355,7 +355,13 @@ Ox.load.UI = function(options, callback) { name: name, theme: theme })) + '-->' ); - }; + }, { + key: function(args) { + args[1] = args[1] || 'default'; + args[2] = args[2] || Ox.Theme(); + return JSON.stringify(args); + } + }); /*@ Ox.UI.getVideoFormat Get supported video formats (formats) -> of supported formats