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
(cherry picked from commit 06a7b52)
  • Loading branch information
cdujeu committed Jul 12, 2016
1 parent 72f88e2 commit a31c71d
Showing 1 changed file with 2 additions and 0 deletions.
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 a31c71d

Please sign in to comment.