Merge branch 'release/v7.1.0' into develop
This commit is contained in:
commit
d2a22367ac
|
@ -53,7 +53,7 @@
|
|||
.tree-item {
|
||||
width: 100%;
|
||||
min-height: 28px;
|
||||
padding: 0px 6px 0 24px;
|
||||
padding: 0px 12px 0 24px;
|
||||
}
|
||||
|
||||
.name {
|
||||
|
|
|
@ -184,8 +184,9 @@
|
|||
}
|
||||
|
||||
.popover {
|
||||
.list {
|
||||
.page .list{
|
||||
ul {
|
||||
background-color: var(--f7-list-bg-color);
|
||||
li:first-child, li:last-child {
|
||||
.item-link {
|
||||
border-radius: 0;
|
||||
|
|
|
@ -1241,7 +1241,7 @@ define([
|
|||
leftmenuController.getView('LeftMenu').getMenu('file').loadDocument({doc:me.document});
|
||||
leftmenuController.setMode(me.appOptions).createDelayedElements().setApi(me.api);
|
||||
|
||||
navigationController.setApi(me.api).setMode(this.appOptions);
|
||||
navigationController.setMode(me.appOptions).setApi(me.api);
|
||||
|
||||
chatController.setApi(this.api).setMode(this.appOptions);
|
||||
application.getController('Common.Controllers.ExternalDiagramEditor').setApi(this.api).loadConfig({config:this.editorConfig, customization: this.editorConfig.customization});
|
||||
|
|
|
@ -65,6 +65,8 @@ define([
|
|||
if (me.panelNavigation && me.panelNavigation.viewNavigationList && me.panelNavigation.viewNavigationList.scroller)
|
||||
me.panelNavigation.viewNavigationList.scroller.update({alwaysVisibleY: true});
|
||||
}
|
||||
if (!me.mode.isEdit && !me.mode.isRestrictedEdit)
|
||||
me.panelNavigation.viewNavigationList.focus();
|
||||
},
|
||||
'hide': function() {
|
||||
if (!this.canUseViwerNavigation) {
|
||||
|
@ -103,8 +105,10 @@ define([
|
|||
setMode: function(mode) {
|
||||
this.mode = mode;
|
||||
this.canUseViwerNavigation = this.mode.canUseViwerNavigation;
|
||||
if (this.panelNavigation && this.panelNavigation.viewNavigationList)
|
||||
if (this.panelNavigation && this.panelNavigation.viewNavigationList) {
|
||||
this.panelNavigation.viewNavigationList.setEmptyText(this.mode.isEdit ? this.panelNavigation.txtEmpty : this.panelNavigation.txtEmptyViewer);
|
||||
this.panelNavigation.viewNavigationList.enableKeyEvents = !this.mode.isEdit && !this.mode.isRestrictedEdit;
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
|
@ -232,7 +236,7 @@ define([
|
|||
} else if (this._viewerNavigationObject) {
|
||||
this.api.asc_viewerNavigateTo(record.get('index'));
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', this.panelNavigation);
|
||||
(this.mode.isEdit || this.mode.isRestrictedEdit) && Common.NotificationCenter.trigger('edit:complete', this.panelNavigation);
|
||||
},
|
||||
|
||||
onItemAdd: function(picker, item, record, e){
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
.name {
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
word-break: break-word;
|
||||
max-height: 350px;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -620,6 +620,7 @@ class MainController extends Component {
|
|||
default:
|
||||
storeTextSettings.resetBullets(-1);
|
||||
storeTextSettings.resetNumbers(-1);
|
||||
storeTextSettings.resetMultiLevel(-1);
|
||||
}
|
||||
});
|
||||
this.api.asc_registerCallback('asc_onPrAlign', (align) => {
|
||||
|
|
|
@ -286,11 +286,11 @@ const PageMultiLevel = observer( props => {
|
|||
<View className='multilevels dataview'>
|
||||
<List className="row" style={{listStyle: 'none'}}>
|
||||
{arrayMultiLevel.map((item) => (
|
||||
<ListItem key={'multi-level-' + item.type} data-type={item.type} className={item.type === typeMultiLevel ? 'active' : ''}
|
||||
onClick={(e) => {
|
||||
item.type === -1 ? storeTextSettings.resetMultiLevel(-1) : storeTextSettings.resetMultiLevel(null);
|
||||
props.onMultiLevelList(item.type);
|
||||
}}>
|
||||
<ListItem
|
||||
key={'multi-level-' + item.type}
|
||||
data-type={item.type}
|
||||
className={item.type === typeMultiLevel && storeTextSettings.listType === -1 ? 'active' : ''}
|
||||
onClick={() => props.onMultiLevelList(item.type)}>
|
||||
{item.thumb.length < 1 ?
|
||||
<Icon className="thumb" style={{position: 'relative'}}>
|
||||
<label>{t('Edit.textNone')}</label>
|
||||
|
|
|
@ -65,7 +65,8 @@ define([
|
|||
'PrintWithPreview': {
|
||||
'show': _.bind(this.onShowMainSettingsPrint, this),
|
||||
'render:after': _.bind(this.onAfterRender, this),
|
||||
'changerange': _.bind(this.onChangeRange, this, false)
|
||||
'changerange': _.bind(this.onChangeRange, this, false),
|
||||
'openheader': _.bind(this.onOpenHeaderSettings, this),
|
||||
},
|
||||
'PrintSettings': {
|
||||
'changerange': _.bind(this.onChangeRange, this, true)
|
||||
|
@ -82,7 +83,13 @@ define([
|
|||
onAfterRender: function(view) {
|
||||
var me = this;
|
||||
this.printSettings.menu.on('menu:hide', _.bind(this.onHidePrintMenu, this));
|
||||
this.printSettings.cmbSheet.on('selected', _.bind(this.comboSheetsChange, this, this.printSettings));
|
||||
this.printSettings.cmbSheet.on('selected', _.bind(function (combo, record) {
|
||||
this.comboSheetsChange(this.printSettings, combo, record);
|
||||
if (this._isPreviewVisible) {
|
||||
this.notUpdateSheetSettings = true;
|
||||
this.api.asc_drawPrintPreview(undefined, record.value);
|
||||
}
|
||||
}, this));
|
||||
this.printSettings.btnsSave.forEach(function (btn) {
|
||||
btn.on('click', _.bind(me.querySavePrintSettings, me, false));
|
||||
});
|
||||
|
@ -96,13 +103,14 @@ define([
|
|||
'keyup:after': _.bind(this.onKeyupPageNumber, this)
|
||||
});
|
||||
this.printSettings.txtNumberPage.cmpEl.find('input').on('blur', _.bind(this.onBlurPageNumber, this));
|
||||
this.printSettings.chIgnorePrintArea.on('change', _.bind(this.updatePreview, this));
|
||||
this.printSettings.chIgnorePrintArea.on('change', _.bind(this.updatePreview, this, true));
|
||||
|
||||
this.fillComponents(this.printSettings);
|
||||
this.registerControlEvents(this.printSettings);
|
||||
|
||||
Common.NotificationCenter.on('window:resize', _.bind(function () {
|
||||
if (this._isPreviewVisible) {
|
||||
this.notUpdateSheetSettings = true;
|
||||
this.api.asc_drawPrintPreview(this._navigationPreview.currentPage);
|
||||
}
|
||||
}, this));
|
||||
|
@ -115,7 +123,7 @@ define([
|
|||
this.api = o;
|
||||
this.api.asc_registerCallback('asc_onSheetsChanged', _.bind(this.updateSheetsInfo, this));
|
||||
this.api.asc_registerCallback('asc_onPrintPreviewSheetChanged', _.bind(this.onApiChangePreviewSheet, this));
|
||||
this.api.asc_registerCallback('asc_onUpdateDocumentProps', _.bind(this.updateDocumentProps, this));
|
||||
this.api.asc_registerCallback('asc_onPrintPreviewPageChanged', _.bind(this.onApiChangePreviewPage, this));
|
||||
},
|
||||
|
||||
updateSheetsInfo: function() {
|
||||
|
@ -148,7 +156,11 @@ define([
|
|||
},
|
||||
|
||||
comboSheetsChange: function(panel, combo, record) {
|
||||
this.fillPageOptions(panel, this._changedProps[record.value] ? this._changedProps[record.value] : this.api.asc_getPageOptions(record.value, true), record.value);
|
||||
var currentSheet = record.value;
|
||||
this.fillPageOptions(panel, this._changedProps[currentSheet] ? this._changedProps[currentSheet] : this.api.asc_getPageOptions(currentSheet, true), currentSheet);
|
||||
if (!this._changedProps[currentSheet]) {
|
||||
this._changedProps[currentSheet] = this.getPageOptions(this.printSettings, currentSheet);
|
||||
}
|
||||
},
|
||||
|
||||
fillPageOptions: function(panel, props, sheet) {
|
||||
|
@ -244,16 +256,16 @@ define([
|
|||
menu.chIgnorePrintArea.setDisabled(printtype == Asc.c_oAscPrintType.Selection);
|
||||
|
||||
if (!isDlg) {
|
||||
this.updatePreview();
|
||||
this.updatePreview(true);
|
||||
}
|
||||
},
|
||||
|
||||
getPageOptions: function(panel) {
|
||||
var props = new Asc.asc_CPageOptions();
|
||||
getPageOptions: function(panel, sheet) {
|
||||
var props = this._changedProps[sheet] ? this._changedProps[sheet] : new Asc.asc_CPageOptions();
|
||||
props.asc_setGridLines(panel.chPrintGrid.getValue()==='checked');
|
||||
props.asc_setHeadings(panel.chPrintRows.getValue()==='checked');
|
||||
|
||||
var opt = new Asc.asc_CPageSetup();
|
||||
var opt = this._changedProps[sheet] ? this._changedProps[sheet].asc_getPageSetup() : new Asc.asc_CPageSetup();
|
||||
opt.asc_setOrientation(panel.cmbPaperOrientation.getValue() == '-' ? undefined : panel.cmbPaperOrientation.getValue());
|
||||
|
||||
var pagew = /^\d{3}\.?\d*/.exec(panel.cmbPaperSize.getValue());
|
||||
|
@ -275,15 +287,19 @@ define([
|
|||
opt.asc_setFitToHeight(this.fitHeight);
|
||||
opt.asc_setScale(this.fitScale);
|
||||
}
|
||||
props.asc_setPageSetup(opt);
|
||||
if (!this._changedProps[sheet]) {
|
||||
props.asc_setPageSetup(opt);
|
||||
}
|
||||
|
||||
opt = new Asc.asc_CPageMargins();
|
||||
opt = this._changedProps[sheet] ? this._changedProps[sheet].asc_getPageMargins() : new Asc.asc_CPageMargins();
|
||||
opt.asc_setLeft(panel.spnMarginLeft.getValue() == '-' ? undefined : Common.Utils.Metric.fnRecalcToMM(panel.spnMarginLeft.getNumberValue())); // because 1.91*10=19.0999999...
|
||||
opt.asc_setTop(panel.spnMarginTop.getValue() == '-' ? undefined : Common.Utils.Metric.fnRecalcToMM(panel.spnMarginTop.getNumberValue()));
|
||||
opt.asc_setRight(panel.spnMarginRight.getValue() == '-' ? undefined : Common.Utils.Metric.fnRecalcToMM(panel.spnMarginRight.getNumberValue()));
|
||||
opt.asc_setBottom(panel.spnMarginBottom.getValue() == '-' ? undefined : Common.Utils.Metric.fnRecalcToMM(panel.spnMarginBottom.getNumberValue()));
|
||||
|
||||
props.asc_setPageMargins(opt);
|
||||
if (!this._changedProps[sheet]) {
|
||||
props.asc_setPageMargins(opt);
|
||||
}
|
||||
|
||||
var check = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PrintTitles, panel.txtRangeTop.getValue(), false) !== Asc.c_oAscError.ID.DataRangeError;
|
||||
props.asc_setPrintTitlesHeight(check ? panel.txtRangeTop.getValue() : panel.dataRangeTop);
|
||||
|
@ -321,6 +337,7 @@ define([
|
|||
this.printSettings.txtNumberPage.checkValidate();
|
||||
}
|
||||
this._isPreviewVisible = true;
|
||||
!!pageCount && this.updatePreview();
|
||||
},
|
||||
|
||||
openPrintSettings: function(type, cmp, format, asUrl) {
|
||||
|
@ -480,7 +497,8 @@ define([
|
|||
me.fitScale = result.scale;
|
||||
me.setScaling(panel, me.fitWidth, me.fitHeight, me.fitScale);
|
||||
if (me._changedProps) {
|
||||
me._changedProps[panel.cmbSheet.getValue()] = me.getPageOptions(panel);
|
||||
var currentSheet = panel.cmbSheet.getValue();
|
||||
me._changedProps[currentSheet] = me.getPageOptions(panel, currentSheet);
|
||||
me.updatePreview();
|
||||
}
|
||||
}
|
||||
|
@ -498,7 +516,8 @@ define([
|
|||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
} else {
|
||||
if (this._changedProps) {
|
||||
this._changedProps[panel.cmbSheet.getValue()] = this.getPageOptions(panel);
|
||||
var currentSheet = panel.cmbSheet.getValue();
|
||||
this._changedProps[currentSheet] = this.getPageOptions(panel, currentSheet);
|
||||
this.updatePreview();
|
||||
}
|
||||
}
|
||||
|
@ -690,7 +709,7 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
updatePreview: function () {
|
||||
updatePreview: function (needUpdate) {
|
||||
if (this._isPreviewVisible) {
|
||||
var adjPrintParams = new Asc.asc_CAdjustPrint(),
|
||||
printType = this.printSettings.getRange();
|
||||
|
@ -713,6 +732,7 @@ define([
|
|||
newPage = this._navigationPreview.currentPage;
|
||||
}
|
||||
|
||||
this.notUpdateSheetSettings = !needUpdate;
|
||||
this.api.asc_drawPrintPreview(newPage);
|
||||
|
||||
this.updateNavigationButtons(newPage, pageCount);
|
||||
|
@ -720,6 +740,10 @@ define([
|
|||
},
|
||||
|
||||
onApiChangePreviewSheet: function (index) {
|
||||
if (this.notUpdateSheetSettings) {
|
||||
this.notUpdateSheetSettings = false;
|
||||
return
|
||||
}
|
||||
var item = this.printSettings.cmbSheet.store.findWhere({value: index});
|
||||
if (item) {
|
||||
this.printSettings.cmbSheet.setValue(item.get('value'));
|
||||
|
@ -749,10 +773,16 @@ define([
|
|||
this.printSettings.btnNextPage.setDisabled(curPage > pageCount - 2);
|
||||
},
|
||||
|
||||
updateDocumentProps: function (index) {
|
||||
if (this._isPreviewVisible) {
|
||||
this._changedProps[index] = this.api.asc_getPageOptions(index);
|
||||
this.updatePreview();
|
||||
onOpenHeaderSettings: function () {
|
||||
var pageSetup = this._changedProps[this.printSettings.cmbSheet.getValue()].asc_getPageSetup();
|
||||
SSE.getController('Toolbar').onEditHeaderClick(pageSetup);
|
||||
},
|
||||
|
||||
onApiChangePreviewPage: function (page) {
|
||||
if (this._navigationPreview.currentPage !== page) {
|
||||
this._navigationPreview.currentPage = page;
|
||||
this.updateNavigationButtons(page, this._navigationPreview.pageCount);
|
||||
this.disableNavButtons();
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -419,7 +419,7 @@ define([
|
|||
toolbar.btnImgForward.on('click', this.onImgArrangeSelect.bind(this, 'forward'));
|
||||
toolbar.btnImgBackward.on('click', this.onImgArrangeSelect.bind(this, 'backward'));
|
||||
toolbar.btnsEditHeader.forEach(function(button) {
|
||||
button.on('click', _.bind(me.onEditHeaderClick, me));
|
||||
button.on('click', _.bind(me.onEditHeaderClick, me, undefined));
|
||||
});
|
||||
toolbar.btnPrintTitles.on('click', _.bind(this.onPrintTitlesClick, this));
|
||||
toolbar.chPrintGridlines.on('change', _.bind(this.onPrintGridlinesChange, this));
|
||||
|
@ -4076,7 +4076,7 @@ define([
|
|||
this.toolbar.btnPrintArea.menu.items[2].setVisible(this.api.asc_CanAddPrintArea());
|
||||
},
|
||||
|
||||
onEditHeaderClick: function(btn) {
|
||||
onEditHeaderClick: function(pageSetup, btn) {
|
||||
var me = this;
|
||||
if (_.isUndefined(me.fontStore)) {
|
||||
me.fontStore = new Common.Collections.Fonts();
|
||||
|
@ -4093,6 +4093,7 @@ define([
|
|||
var win = new SSE.Views.HeaderFooterDialog({
|
||||
api: me.api,
|
||||
fontStore: me.fontStore,
|
||||
pageSetup: pageSetup,
|
||||
handler: function(dlg, result) {
|
||||
if (result === 'ok') {
|
||||
me.getApplication().getController('Print').updatePreview();
|
||||
|
|
|
@ -2681,7 +2681,7 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({
|
|||
},
|
||||
|
||||
openHeaderSettings: function() {
|
||||
SSE.getController('Toolbar').onEditHeaderClick();
|
||||
this.fireEvent('openheader', this);
|
||||
},
|
||||
|
||||
updateCountOfPages: function (count) {
|
||||
|
|
|
@ -63,6 +63,7 @@ define([
|
|||
this.api = this.options.api;
|
||||
this.props = this.options.props;
|
||||
this.fontStore = this.options.fontStore;
|
||||
this.pageSetup = this.options.pageSetup;
|
||||
this.isFooter = false;
|
||||
this.currentCanvas = null;
|
||||
this.headerControls = [];
|
||||
|
@ -619,7 +620,7 @@ define([
|
|||
Common.UI.Window.prototype.close.apply(this, arguments);
|
||||
|
||||
if (this.HFObject)
|
||||
this.HFObject.destroy();
|
||||
this.HFObject.destroy(false, this.pageSetup);
|
||||
},
|
||||
|
||||
afterRender: function () {
|
||||
|
@ -631,7 +632,7 @@ define([
|
|||
this.cmbFonts[1].fillFonts(this.fontStore);
|
||||
this.updateThemeColors();
|
||||
|
||||
this.HFObject = new Asc.asc_CHeaderFooterEditor(['header-left-img', 'header-center-img', 'header-right-img', 'footer-left-img', 'footer-center-img', 'footer-right-img'], 205);
|
||||
this.HFObject = new Asc.asc_CHeaderFooterEditor(['header-left-img', 'header-center-img', 'header-right-img', 'footer-left-img', 'footer-center-img', 'footer-right-img'], 205, undefined, this.pageSetup);
|
||||
this._setDefaults(this.props);
|
||||
this.editorCanvas = this.$window.find('#ce-canvas-menu');
|
||||
var me = this;
|
||||
|
@ -697,7 +698,7 @@ define([
|
|||
|
||||
_handleInput: function(state) {
|
||||
if (this.HFObject) {
|
||||
var id = this.HFObject.destroy(state=='ok');
|
||||
var id = this.HFObject.destroy(state=='ok', this.pageSetup);
|
||||
if (id) {
|
||||
var me = this;
|
||||
this.showError(function() {
|
||||
|
|
Loading…
Reference in a new issue