Fix loader for compact header mode

This commit is contained in:
Julia Radzhabova 2019-11-25 14:23:27 +03:00
parent e0aecd9704
commit 9e246ec424
7 changed files with 30 additions and 7 deletions

View file

@ -783,10 +783,13 @@
if (config.frameEditorId)
params += "&frameEditorId=" + config.frameEditorId;
if (config.editorConfig && (config.editorConfig.mode == 'view' || config.editorConfig.customization && !!config.editorConfig.customization.compactHeader) ||
if (config.editorConfig && config.editorConfig.mode == 'view' ||
config.document && config.document.permissions && (config.document.permissions.edit === false && !config.document.permissions.review ))
params += "&mode=view";
if (config.editorConfig && config.editorConfig.customization && !!config.editorConfig.customization.compactHeader)
params += "&compact=true";
return params;
}

View file

@ -223,11 +223,14 @@
<script>
var params = getUrlParams(),
compact = params["compact"] == 'true',
view = params["mode"] == 'view';
if (view) {
if (compact || view) {
document.querySelector('.brendpanel > :nth-child(2)').remove();
document.querySelector('.brendpanel > :nth-child(1)').style.height = '32px';
}
if (view) {
document.querySelector('.sktoolbar').remove();
}

View file

@ -209,12 +209,17 @@
<script>
var params = getUrlParams(),
compact = params["compact"] == 'true',
view = params["mode"] == 'view';
if (view) {
if (compact || view) {
document.querySelector('.brendpanel > :nth-child(2)').remove();
document.querySelector('.brendpanel > :nth-child(1)').style.height = '32px';
}
if (view) {
document.querySelector('.sktoolbar').remove();
}
if (stopLoading) {
document.body.removeChild(document.getElementById('loading-mask'));
} else {

View file

@ -252,11 +252,14 @@
<script>
var params = getUrlParams(),
compact = params["compact"] == 'true',
view = params["mode"] == 'view';
if (view) {
if (compact || view) {
document.querySelector('.brendpanel > :nth-child(2)').remove();
document.querySelector('.brendpanel > :nth-child(1)').style.height = '32px';
}
if (view) {
document.querySelector('.sktoolbar').remove();
}

View file

@ -258,11 +258,14 @@
<script>
var params = getUrlParams(),
compact = params["compact"] == 'true',
view = params["mode"] == 'view';
if (view) {
if (compact || view) {
document.querySelector('.brendpanel > :nth-child(2)').remove();
document.querySelector('.brendpanel > :nth-child(1)').style.height = '32px';
}
if (view) {
document.querySelector('.sktoolbar').remove();
}

View file

@ -224,6 +224,7 @@
<script>
var params = getUrlParams(),
internal = params["internal"] == 'true',
compact = params["compact"] == 'true',
view = params["mode"] == 'view';
if (internal) {
@ -231,9 +232,11 @@
document.querySelector('.sktoolbar').remove();
}
if (view) {
if (compact || view) {
document.querySelector('.brendpanel > :nth-child(2)').remove();
document.querySelector('.brendpanel > :nth-child(1)').style.height = '32px';
}
if (view) {
document.querySelector('.sktoolbar').remove();
}

View file

@ -229,6 +229,7 @@
<script>
var params = getUrlParams(),
internal = params["internal"] == 'true',
compact = params["compact"] == 'true',
view = params["mode"] == 'view';
if (internal) {
@ -236,9 +237,11 @@
document.querySelector('.sktoolbar').remove();
}
if (view) {
if (compact || view) {
document.querySelector('.brendpanel > :nth-child(2)').remove();
document.querySelector('.brendpanel > :nth-child(1)').style.height = '32px';
}
if (view) {
document.querySelector('.sktoolbar').remove();
}