Merge pull request #930 from ONLYOFFICE/fix/bugfix

Fix/bugfix
This commit is contained in:
Julia Radzhabova 2021-06-18 17:29:05 +03:00 committed by GitHub
commit dfa8cbd80d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 45 additions and 17 deletions

View file

@ -866,7 +866,8 @@
path += app + "/";
path += (config.type === "mobile" || isSafari_mobile)
? "mobile"
: (config.type === "embedded" || (app=='documenteditor') && config.document.permissions && (config.document.permissions.fillForms===true) && (config.document.permissions.edit === false) && (config.editorConfig.mode !== 'view'))
: (config.type === "embedded" || (app=='documenteditor') && config.document && config.document.permissions && (config.document.permissions.fillForms===true) &&
(config.document.permissions.edit === false) && (config.document.permissions.review !== true) && (config.editorConfig.mode !== 'view'))
? "embed"
: "main";

View file

@ -641,6 +641,14 @@ Common.Utils.String = new (function() {
var nTrailingChar = 0xDC00 | (nUnicode & 0x3FF);
return String.fromCharCode(nLeadingChar) + String.fromCharCode(nTrailingChar);
}
},
fixedDigits: function(num, digits, fill) {
(fill===undefined) && (fill = '0');
var strfill = "",
str = num.toString();
for (var i=str.length; i<digits; i++) strfill += fill;
return strfill + str;
}
}
})();

View file

@ -99,7 +99,7 @@
'<div class="separator horizontal"></div>',
'<div class="footer right">',
'<button class="btn normal dlg-btn" result="replace">'+this.txtBtnReplace+'</button>',
'<button class="btn normal dlg-btn" result="replaceall" style="margin-left: 6px;">'+this.txtBtnReplaceAll+'</button>',
'<button class="btn normal dlg-btn" result="replaceall" style="margin-left: 6px;width: auto;">'+this.txtBtnReplaceAll+'</button>',
'<button class="btn normal dlg-btn iconic" result="back"><span class="icon img-commonctrl back"></span></button>',
'<button class="btn normal dlg-btn iconic" result="next" style="margin-left: 6px;"><span class="icon img-commonctrl next"></span></button>',
'</div>'

View file

@ -49,6 +49,7 @@
.asc-loadmask-title {
.fontsize(@font-size-large);
margin: 0 8px 0 12px;
white-space: pre-wrap;
}
.left-panel & {

View file

@ -942,7 +942,7 @@ define([
break;
case LoadingDocument:
title = this.loadingDocumentTitleText;
title = this.loadingDocumentTitleText + ' ';
text = this.loadingDocumentTextText;
break;
default:
@ -1246,7 +1246,7 @@ define([
onOpenDocument: function(progress) {
var elem = document.getElementById('loadmask-text');
var proc = (progress.asc_getCurrentFont() + progress.asc_getCurrentImage())/(progress.asc_getFontsCount() + progress.asc_getImagesCount());
proc = this.textLoadingDocument + ': ' + Math.min(Math.round(proc*100), 100) + '%';
proc = this.textLoadingDocument + ': ' + Common.Utils.String.fixedDigits(Math.min(Math.round(proc*100), 100), 3, " ") + "%";
elem ? elem.innerHTML = proc : this.loadMask && this.loadMask.setTitle(proc);
},

View file

@ -1227,8 +1227,12 @@ define([
onHorizontalAlign: function(type, btn, e) {
this._state.pralign = undefined;
if (this.api)
if (this.api) {
if (!btn.pressed) {
type = (type==1) ? 3 : 1;
}
this.api.put_PrAlign(type);
}
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
Common.component.Analytics.trackEvent('ToolBar', 'Align');

View file

@ -311,7 +311,6 @@ define([
cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-align-left',
enableToggle: true,
allowDepress: false,
toggleGroup: 'alignGroup'
});
this.paragraphControls.push(this.btnAlignLeft);
@ -321,7 +320,6 @@ define([
cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-align-center',
enableToggle: true,
allowDepress: false,
toggleGroup: 'alignGroup'
});
this.paragraphControls.push(this.btnAlignCenter);
@ -331,7 +329,6 @@ define([
cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-align-right',
enableToggle: true,
allowDepress: false,
toggleGroup: 'alignGroup'
});
this.paragraphControls.push(this.btnAlignRight);
@ -341,12 +338,10 @@ define([
cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-align-just',
enableToggle: true,
allowDepress: false,
toggleGroup: 'alignGroup'
});
this.paragraphControls.push(this.btnAlignJust);
this.btnDecLeftOffset = new Common.UI.Button({
id: 'id-toolbar-btn-decoffset',
cls: 'btn-toolbar',

View file

@ -691,7 +691,7 @@ define([
break;
case LoadingDocument:
title = this.loadingDocumentTitleText;
title = this.loadingDocumentTitleText + ' ';
text = this.loadingDocumentTextText;
break;
default:
@ -981,7 +981,7 @@ define([
onOpenDocument: function(progress) {
var elem = document.getElementById('loadmask-text');
var proc = (progress.asc_getCurrentFont() + progress.asc_getCurrentImage())/(progress.asc_getFontsCount() + progress.asc_getImagesCount());
proc = this.textLoadingDocument + ': ' + Math.min(Math.round(proc*100), 100) + '%';
proc = this.textLoadingDocument + ': ' + Common.Utils.String.fixedDigits(Math.min(Math.round(proc*100), 100), 3, " ") + "%";
elem ? elem.innerHTML = proc : this.loadMask && this.loadMask.setTitle(proc);
},

View file

@ -739,7 +739,7 @@ define([
break;
case LoadingDocument:
title = this.loadingDocumentTitleText;
title = this.loadingDocumentTitleText + ' ';
break;
default:
if (typeof action.id == 'string'){
@ -1043,7 +1043,7 @@ define([
onOpenDocument: function(progress) {
var elem = document.getElementById('loadmask-text');
var proc = (progress.asc_getCurrentFont() + progress.asc_getCurrentImage())/(progress.asc_getFontsCount() + progress.asc_getImagesCount());
proc = this.textLoadingDocument + ': ' + Math.min(Math.round(proc*100), 100) + '%';
proc = this.textLoadingDocument + ': ' + Common.Utils.String.fixedDigits(Math.min(Math.round(proc*100), 100), 3, " ") + "%";
elem ? elem.innerHTML = proc : this.loadMask && this.loadMask.setTitle(proc);
},
@ -1739,7 +1739,7 @@ define([
}
if (!Common.Utils.ModalWindow.isVisible() || $('.asc-window.modal.alert[data-value=' + id + ']').length<1)
Common.UI.alert(config).$window.attr('data-value', id);
setTimeout(function() {Common.UI.alert(config).$window.attr('data-value', id);}, 1);
(id!==undefined) && Common.component.Analytics.trackEvent('Internal Error', id.toString());
},

View file

@ -1419,6 +1419,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.cmbLegendPos.setValue(props.getLegendPos());
this.updateDataLabels(this._state.ChartType, props.getDataLabelsPos());
this.cmbDataLabels.setDisabled(this._state.ChartType==Asc.c_oAscChartTypeSettings.surfaceNormal ||
this._state.ChartType == Asc.c_oAscChartTypeSettings.surfaceWireframe);
this.chSeriesName.setValue(this.chartSettings.getShowSerName(), true);
this.chCategoryName.setValue(this.chartSettings.getShowCatName(), true);

View file

@ -232,8 +232,25 @@ define([
this.mnuChartTypePicker.selectRecord(record, true);
if (record) {
this.btnChartType.setIconCls('svgicon ' + 'chart-' + record.get('iconCls'));
} else
this.btnChartType.setIconCls('svgicon');
} else {
var iconcls = '';
switch (this.currentChartType) {
case Asc.c_oAscChartTypeSettings.surfaceNormal:
iconcls = 'chart-surface-normal';
break;
case Asc.c_oAscChartTypeSettings.surfaceWireframe:
iconcls = 'chart-surface-wireframe';
break;
case Asc.c_oAscChartTypeSettings.contourNormal:
iconcls = 'chart-contour-wireframe';
break;
case Asc.c_oAscChartTypeSettings.contourWireframe:
iconcls = 'chart-contour-wireframe';
break;
}
this.btnChartType.setIconCls('svgicon ' + iconcls);
}
this.seriesList.on('item:add', _.bind(this.addControls, this));
this.seriesList.on('item:change', _.bind(this.addControls, this));
this.ShowHideSettings(this.currentChartType);