diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 80cea7e8b..0f399fa3a 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -115,7 +115,8 @@ mail: 'support@gmail.com', www: 'www.superpuper.com', info: 'Some info', - logo: '' + logo: '', + logoDark: '', // logo for dark theme }, about: true, feedback: { diff --git a/apps/common/main/lib/view/About.js b/apps/common/main/lib/view/About.js index 5a5185e19..ba6b67ead 100644 --- a/apps/common/main/lib/view/About.js +++ b/apps/common/main/lib/view/About.js @@ -196,6 +196,7 @@ define([ this.licData = data || true; } else { if (data && typeof data == 'object' && typeof(data.customer)=='object') { + this.licData = data; var customer = data.customer; $('#id-about-licensor-logo').addClass('hidden'); @@ -229,9 +230,11 @@ define([ this.lblCompanyLic.text(value) : this.lblCompanyLic.parents('tr').addClass('hidden'); - (value = customer.logo) && value.length ? + value = Common.UI.Themes.isDarkTheme() ? (customer.logoDark || customer.logo) : (customer.logo || customer.logoDark); + value.length ? this.divCompanyLogo.html('') : this.divCompanyLogo.parents('tr').addClass('hidden'); + value.length && Common.NotificationCenter.on('uitheme:changed', this.changeLogo.bind(this)); } else { this.cntLicenseeInfo.addClass('hidden'); this.cntLicensorInfo.addClass('margin-bottom'); @@ -239,6 +242,15 @@ define([ } }, + changeLogo: function () { + if (!this.licData) return; + + var customer = this.licData.customer; + if ( customer.logo && customer.logoDark && customer.logo !== customer.logoDark) { + this.divCompanyLogo.find('img').attr('src', Common.UI.Themes.isDarkTheme() ? (customer.logoDark || customer.logo) : (customer.logo || customer.logoDark)); + } + }, + show: function () { if ( !this.rendered ) this.render(); diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index 56ca5e544..f153840fe 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -631,7 +631,7 @@ define([ changeLogo: function () { var value = this.branding; - if ( value && value.logo && (value.logo.image || value.logo.imageDark) && (value.logo.image !== value.logo.imageDark)) { + if ( value && value.logo && value.logo.image && value.logo.imageDark && (value.logo.image !== value.logo.imageDark)) { // change logo when image and imageDark are different var image = Common.UI.Themes.isDarkTheme() ? (value.logo.imageDark || value.logo.image) : (value.logo.image || value.logo.imageDark); $('#header-logo img').attr('src', image); }