Skip to content
Snippets Groups Projects
Commit a5e89250 authored by Robin Appelman's avatar Robin Appelman
Browse files

more robust png fallback

parent 797e921b
Branches
No related tags found
No related merge requests found
......@@ -252,16 +252,22 @@ function replaceSVG(){
$('.svg').each(function(index,element){
element=$(element);
var background=element.css('background-image');
if(background && background!='none'){
background=background.substr(0,background.length-4)+'png)';
element.css('background-image',background);
if(background){
var i=background.lastIndexOf('.svg');
if(i>=0){
background=background.substr(0,i)+'.png'+background.substr(i+4);
element.css('background-image',background);
}
}
element.find('*').each(function(index,element) {
element=$(element);
var background=element.css('background-image');
if(background && background!='none'){
background=background.substr(0,background.length-4)+'png)';
element.css('background-image',background);
if(background){
var i=background.lastIndexOf('.svg');
if(i>=0){
background=background.substr(0,i)+'.png'+background.substr(i+4);
element.css('background-image',background);
}
}
});
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment