Fix logo image for pdf-forms

This commit is contained in:
Julia Radzhabova
2024-06-27 18:07:52 +03:00
parent 07a3019b2c
commit 1f38529ac4
5 changed files with 26 additions and 14 deletions

View File

@ -6,7 +6,7 @@
@import "../../../../common/main/resources/less/colors-table-classic.less";
@import "../../../../common/main/resources/less/colors-table-dark.less";
@import "../../../../common/main/resources/less/colors-table-dark-contrast.less";
@import "../../../../common/main/resources/less/colors-table-gray.less";
// Core variables and mixins
//@import "../../../../../vendor/bootstrap/less/variables.less";

View File

@ -59,7 +59,8 @@ define([
mouseMoveData = null,
isTooltipHiding = false,
bodyWidth = 0,
ttOffset = [0, -10];
ttOffset = [0, -10],
_logoImage = '';
DE.Controllers.ApplicationController = Backbone.Controller.extend(_.assign({
views: [
@ -839,9 +840,10 @@ define([
return;
}
if (value.logo.image || value.logo.imageDark) {
var image = Common.UI.Themes.isDarkTheme() ? (value.logo.imageDark || value.logo.image) : (value.logo.image || value.logo.imageDark);
logo.html('<img src="' + image + '" style="max-width:100px; max-height:20px;"/>');
if (value.logo.image || value.logo.imageDark || value.logo.imageLight) {
_logoImage = Common.UI.Themes.isDarkTheme() ? (value.logo.imageDark || value.logo.image || value.logo.imageLight) :
(value.logo.imageLight || value.logo.image || value.logo.imageDark);
logo.html('<img src="' + _logoImage + '" style="max-width:100px; max-height:20px;"/>');
logo.css({'background-image': 'none', width: 'auto', height: 'auto'});
}
@ -1627,9 +1629,13 @@ define([
if (this.appOptions.canBranding) {
var value = this.appOptions.customization;
if ( value && value.logo && (value.logo.image || value.logo.imageDark) && (value.logo.image !== value.logo.imageDark)) {
var image = Common.UI.Themes.isDarkTheme() ? (value.logo.imageDark || value.logo.image) : (value.logo.image || value.logo.imageDark);
$('#header-logo img').attr('src', image);
if ( value && value.logo && (value.logo.image || value.logo.imageDark || value.logo.imageLight)) {
var image = Common.UI.Themes.isDarkTheme() ? (value.logo.imageDark || value.logo.image || value.logo.imageLight) :
(value.logo.imageLight || value.logo.image || value.logo.imageDark);
if (_logoImage !== image) {
_logoImage = image;
$('#header-logo img').attr('src', image);
}
}
}
},

View File

@ -227,7 +227,8 @@
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
hideLogo = params["headerlogo"]==='',
logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null,
logoDark = params["headerlogodark"] ? encodeUrlParam(params["headerlogodark"]) : null;
logoDark = params["headerlogodark"] ? encodeUrlParam(params["headerlogodark"]) : null,
logoLight = params["headerlogolight"] ? encodeUrlParam(params["headerlogolight"]) : null;
window.frameEditorId = params["frameEditorId"];
window.parentOrigin = params["parentOrigin"];
@ -242,12 +243,12 @@
if (elem) {
if (hideLogo) {
elem.style.display = 'none';
} else if (logo || logoDark) {
} else if (logo || logoDark || logoLight) {
elem.style.backgroundImage= 'none';
elem.style.width = 'auto';
elem.style.height = 'auto';
var img = document.querySelector('.loading-logo img');
img && img.setAttribute('src', /theme-dark/.test(document.body.className) ? logoDark || logo : logo || logoDark);
img && img.setAttribute('src', /theme-dark/.test(document.body.className) ? logoDark || logo || logoLight : logoLight || logo || logoDark);
img.style.opacity = 1;
}
}

View File

@ -211,7 +211,8 @@
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
hideLogo = params["headerlogo"]==='',
logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null,
logoDark = params["headerlogodark"] ? encodeUrlParam(params["headerlogodark"]) : null;
logoDark = params["headerlogodark"] ? encodeUrlParam(params["headerlogodark"]) : null,
logoLight = params["headerlogolight"] ? encodeUrlParam(params["headerlogolight"]) : null;
window.frameEditorId = params["frameEditorId"];
window.parentOrigin = params["parentOrigin"];
@ -223,12 +224,12 @@
if (elem) {
if (hideLogo) {
elem.style.display = 'none';
} else if (logo || logoDark) {
} else if (logo || logoDark || logoLight) {
elem.style.backgroundImage= 'none';
elem.style.width = 'auto';
elem.style.height = 'auto';
var img = document.querySelector('.loading-logo img');
img && img.setAttribute('src', /theme-dark/.test(document.body.className) ? logoDark || logo : logo || logoDark);
img && img.setAttribute('src', /theme-dark/.test(document.body.className) ? logoDark || logo || logoLight : logoLight || logo || logoDark);
img.style.opacity = 1;
}
}

View File

@ -3,6 +3,10 @@
@header-background-color-ie: @toolbar-header-document-ie;
@header-background-color: var(--toolbar-header-document);
@tab-header-ie: @tab-header-document-ie;
@tab-header: var(--tab-header-document);
@tab-toolbar-ie: @tab-toolbar-document-ie;
@tab-toolbar: var(--tab-toolbar-document);
#editor_sdk {
background-color: #fff;