PERF: Use cdn when serving site settings upload.
This commit is contained in:
parent
24347ace10
commit
d5c9ac7196
|
@ -35,10 +35,16 @@ export default Ember.Component.extend(UploadMixin, {
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed("imageUrl")
|
@computed("imageUrl")
|
||||||
backgroundStyle(url) {
|
imageCDNURL(url) {
|
||||||
if (Ember.isEmpty(url)) {
|
if (Ember.isEmpty(url)) {
|
||||||
return "".htmlSafe();
|
return "".htmlSafe();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return Discourse.getURLWithCDN(url);
|
||||||
|
},
|
||||||
|
|
||||||
|
@computed("imageCDNURL")
|
||||||
|
backgroundStyle(url) {
|
||||||
return `background-image: url(${url})`.htmlSafe();
|
return `background-image: url(${url})`.htmlSafe();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
{{#if imageUrl}}
|
{{#if imageUrl}}
|
||||||
<a class="lightbox"
|
<a class="lightbox"
|
||||||
href={{imageUrl}}
|
href={{imageCDNURL}}
|
||||||
title={{imageFilename}}
|
title={{imageFilename}}
|
||||||
rel="nofollow noopener">
|
rel="nofollow noopener">
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue