Skip to content

Commit

Permalink
Merge pull request #2923 from ONLYOFFICE/fix/bugfix
Browse files Browse the repository at this point in the history
Fix/bugfix
  • Loading branch information
JuliaRadzhabova authored Apr 8, 2024
2 parents 5fc8c66 + f115de2 commit a3f6877
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 25 deletions.
7 changes: 4 additions & 3 deletions apps/api/documents/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1056,9 +1056,10 @@
if ( config.editorConfig.customization.logo ) {
if (config.editorConfig.customization.logo.visible===false) {
params += "&headerlogo=";
} else if (config.type=='embedded' && (config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageEmbedded))
params += "&headerlogo=" + encodeURIComponent(config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageEmbedded);
else if (config.type!='embedded' && (config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageDark)) {
} else if (config.type=='embedded' && (config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageEmbedded || config.editorConfig.customization.logo.imageDark)) {
(config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageEmbedded) && (params += "&headerlogo=" + encodeURIComponent(config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageEmbedded));
config.editorConfig.customization.logo.imageDark && (params += "&headerlogodark=" + encodeURIComponent(config.editorConfig.customization.logo.imageDark));
} else if (config.type!='embedded' && (config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageDark)) {
config.editorConfig.customization.logo.image && (params += "&headerlogo=" + encodeURIComponent(config.editorConfig.customization.logo.image));
config.editorConfig.customization.logo.imageDark && (params += "&headerlogodark=" + encodeURIComponent(config.editorConfig.customization.logo.imageDark));
}
Expand Down
2 changes: 1 addition & 1 deletion apps/common/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<script>
listenApiMsg(function (isform) {
var match = window.location.href.match(/(.*)common\/index.html/i);
match && window.location.replace(match[1] + (isform || embed ? 'documenteditor' : 'pdfeditor') + '/' + (isform && embed ? 'forms' : embed ? 'embed' : 'main') + '/index' + postfix + '.html' +
match && window.location.replace(match[1] + (isform || embed ? 'documenteditor' : 'pdfeditor') + '/' + (isform && embed ? 'forms' : embed ? 'embed' : 'main') + '/index' + (isform && embed ? '' : postfix) + '.html' +
window.location.search + ("&isForm=" + !!isform));
});
</script>
Expand Down
2 changes: 1 addition & 1 deletion apps/common/index.html.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<script>
listenApiMsg(function (isform) {
var match = window.location.href.match(/(.*)common\/index.html/i);
match && window.location.replace(match[1] + (isform || embed ? 'documenteditor' : 'pdfeditor') + '/' + (isform && embed ? 'forms' : embed ? 'embed' : 'main') + '/index' + postfix + '.html' +
match && window.location.replace(match[1] + (isform || embed ? 'documenteditor' : 'pdfeditor') + '/' + (isform && embed ? 'forms' : embed ? 'embed' : 'main') + '/index' + (isform && embed ? '' : postfix) + '.html' +
window.location.search + ("&isForm=" + !!isform));
});
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,12 @@ define([
setBranding: function (value) {
if ( value && value.logo) {
var logo = $('#header-logo');
if (value.logo.visible===false) {
logo.addClass('hidden');
logo.parent().removeClass('margin-right-large');
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;"/>');
Expand Down
19 changes: 12 additions & 7 deletions apps/documenteditor/forms/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@

var params = getUrlParams(),
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
hideLogo = params["headerlogo"]==='',
logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null,
logoDark = params["headerlogodark"] ? encodeUrlParam(params["headerlogodark"]) : null;

Expand All @@ -238,13 +239,17 @@
document.body.removeChild(document.getElementById('loading-mask'));
} else {
var elem = document.querySelector('.loading-logo');
if (elem && (logo || logoDark)) {
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.style.opacity = 1;
if (elem) {
if (hideLogo) {
elem.style.display = 'none';
} else if (logo || logoDark) {
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.style.opacity = 1;
}
}
}
</script>
Expand Down
23 changes: 14 additions & 9 deletions apps/documenteditor/forms/index.html.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@

var params = getUrlParams(),
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
hideLogo = params["headerlogo"]==='',
logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null,
logoDark = params["headerlogodark"] ? encodeUrlParam(params["headerlogodark"]) : null;

Expand All @@ -218,15 +219,19 @@
if (stopLoading) {
document.body.removeChild(document.getElementById('loading-mask'));
} else {
var elem = document.querySelector('.loading-logo');
if (elem && (logo || logoDark)) {
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.style.opacity = 1;
}
var elem = document.querySelector('.loading-logo');
if (elem) {
if (hideLogo) {
elem.style.display = 'none';
} else if (logo || logoDark) {
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.style.opacity = 1;
}
}
}
</script>

Expand Down
3 changes: 2 additions & 1 deletion apps/documenteditor/main/resources/less/filemenu.less
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
padding-top: 4px;
cursor: pointer;
.font-size-large();

overflow: hidden;
text-overflow: ellipsis;
&:hover {
text-decoration: none;
}
Expand Down
3 changes: 2 additions & 1 deletion apps/pdfeditor/main/resources/less/filemenu.less
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
padding-top: 4px;
cursor: pointer;
.font-size-large();

overflow: hidden;
text-overflow: ellipsis;
&:hover {
text-decoration: none;
}
Expand Down
3 changes: 2 additions & 1 deletion apps/presentationeditor/main/resources/less/leftmenu.less
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@
padding-top: 4px;
cursor: pointer;
.font-size-large();

overflow: hidden;
text-overflow: ellipsis;
&:hover {
text-decoration: none;
}
Expand Down
3 changes: 2 additions & 1 deletion apps/spreadsheeteditor/main/resources/less/leftmenu.less
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@
padding-top: 4px;
cursor: pointer;
.font-size-large();

overflow: hidden;
text-overflow: ellipsis;
&:hover {
text-decoration: none;
}
Expand Down

0 comments on commit a3f6877

Please sign in to comment.