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

This commit is contained in:
David Taylor 2018-11-22 16:29:12 +00:00
parent 3ff3bb6e2a
commit 0083eec686
1 changed files with 15 additions and 3 deletions

View File

@ -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",