Skip to content

A platform for community discussion. Free, open, simple.

FEATURE: Allow logo URLs to be overridden easily using `reopenWidget()`

David Taylor0083eec6869b
diff --git a/app/assets/javascripts/discourse/widgets/home-logo.js.es6 b/app/assets/javascripts/discourse/widgets/home-logo.js.es6
index 5672cff2852..37bb69a031c 100644
--- a/app/assets/javascripts/discourse/widgets/home-logo.js.es6
+++ b/app/assets/javascripts/discourse/widgets/home-logo.js.es6
@@ -16,18 +16,30 @@ export default createWidget("home-logo", {
return typeof href === "function" ? href() : href;
},
+ logoUrl() {
+ return this.siteSettings.site_logo_url || "";
+ },
+
+ mobileLogoUrl() {
+ return this.siteSettings.site_mobile_logo_url || "";
+ },
+
+ smallLogoUrl() {
+ return this.siteSettings.site_logo_small_url || "";
+ },
+
logo() {
const { siteSettings } = this;
const mobileView = this.site.mobileView;
- const mobileLogoUrl = siteSettings.site_mobile_logo_url || "";
+ const mobileLogoUrl = this.mobileLogoUrl();
const showMobileLogo = mobileView && mobileLogoUrl.length > 0;
- const logoUrl = siteSettings.site_logo_url || "";
+ const logoUrl = this.logoUrl();
const title = siteSettings.title;
if (this.attrs.minimized) {
- const logoSmallUrl = siteSettings.site_logo_small_url || "";
+ const logoSmallUrl = this.smallLogoUrl();
if (logoSmallUrl.length) {
return h("img#site-logo.logo-small", {
key: "logo-small",