Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Escape quotes and parenthesis before setting backgroundImage style
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Jul 6, 2016
1 parent 336da04 commit 06a7b52
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ Class.create("PreviewFactory", {
if(img == null || oImageToLoad.PFacLoader == null) return;
if(oImageToLoad.editorClass.prototype.getCoveringBackgroundSource && oImageToLoad.mainObject && oImageToLoad.mainObject.hasClassName('background-cover') && Modernizr.backgroundsize){
img.setStyle({display:'none'});
var bgUrl = oImageToLoad.editorClass.prototype.getCoveringBackgroundSource(oImageToLoad.ajxpNode);
bgUrl = bgUrl.replace('(', '\\(').replace(')', '\\)').replace('\'', '\\\'');
oImageToLoad.mainObject.setStyle({
backgroundImage:'url(' + oImageToLoad.editorClass.prototype.getCoveringBackgroundSource(oImageToLoad.ajxpNode) + ')',
backgroundSize : 'cover'
Expand Down

0 comments on commit 06a7b52

Please sign in to comment.