Ox.UI.getImageURL: fix color regexp

This commit is contained in:
rolux 2012-06-12 13:17:35 +02:00
parent 359a8984d3
commit 893ba67bc0

View file

@ -309,6 +309,7 @@ Ox.load.UI = function(options, callback) {
Ox.UI.getImageURL = function(name, theme, color) {
var imageURL;
theme = theme || Ox.Theme();
color = Ox.Theme[theme].color[color] || null;
// fixme: not the best idea to do this here
if (name == 'symbolPlay') {
name = 'symbolRight';
@ -317,8 +318,8 @@ Ox.load.UI = function(options, callback) {
if (options.loadImages && color) {
imageURL = 'data:image/svg+xml;base64,' + btoa(
atob(imageURL.split(',')[1]).replace(
/#\d{6}/, '#' + Ox.toHex(Ox.Theme[theme].color[color]
))
/#[0-9A-F]{6}/i, '#' + Ox.toHex(color)
)
);
}
return imageURL;