Skip to content

Commit

Permalink
#995 Properly support file:// protocol when using image styles
Browse files Browse the repository at this point in the history
  • Loading branch information
signalpoint committed Dec 8, 2017
1 parent e20435e commit f81b596
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/widgets/widget.image-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ dg.theme_image_style = function(vars) {

dg.imageStyleUrl = function(styleName, path) {
var src = jDrupal.sitePath() + jDrupal.basePath() + path;
var common = 'sites/default/files/styles/' + styleName + '/public/';
return src.indexOf('public://') != -1 ?
src.replace(
'public://',
'sites/default/files/styles/' + styleName + '/public/'
dg.isCompiled() ?
jDrupal.sitePath() + '/' + common :
common
) : src;
};

0 comments on commit f81b596

Please sign in to comment.