mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-25 14:36:49 +08:00
[PE] Call header/footer settings from print panel
This commit is contained in:
@ -31,7 +31,8 @@
|
||||
*/
|
||||
define([
|
||||
'core',
|
||||
'presentationeditor/main/app/view/FileMenuPanels'
|
||||
'presentationeditor/main/app/view/FileMenuPanels',
|
||||
'presentationeditor/main/app/view/HeaderFooterDialog'
|
||||
], function () {
|
||||
'use strict';
|
||||
|
||||
@ -56,7 +57,8 @@ define([
|
||||
this.addListeners({
|
||||
'PrintWithPreview': {
|
||||
'show': _.bind(this.onShowMainSettingsPrint, this),
|
||||
'render:after': _.bind(this.onAfterRender, this)
|
||||
'render:after': _.bind(this.onAfterRender, this),
|
||||
'openheader': _.bind(this.onOpenHeaderSettings, this)
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -336,6 +338,24 @@ define([
|
||||
}
|
||||
},
|
||||
|
||||
onOpenHeaderSettings: function () {
|
||||
var me = this;
|
||||
(new PE.Views.HeaderFooterDialog({
|
||||
api: this.api,
|
||||
lang: this.api.asc_getDefaultLanguage(),
|
||||
props: this.api.asc_getHeaderFooterProperties(),
|
||||
type: 1,
|
||||
handler: function(result, value) {
|
||||
if (result == 'ok' || result == 'all') {
|
||||
if (me.api) {
|
||||
me.api.asc_setHeaderFooterProperties(value, result == 'all');
|
||||
}
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
}
|
||||
})).show();
|
||||
},
|
||||
|
||||
SetDisabled: function() {
|
||||
if (this.printSettings.isVisible()) {
|
||||
var disable = !this.mode.isEdit;
|
||||
|
||||
@ -447,6 +447,7 @@ define([
|
||||
!this.mode.isDisconnected && this.panels['info'].updateInfo(this.document);
|
||||
this.panels['rights'].setMode(this.mode);
|
||||
!this.mode.isDisconnected && this.panels['rights'].updateInfo(this.document);
|
||||
this.panels['printpreview'] && this.panels['printpreview'].setMode(this.mode);
|
||||
|
||||
if ( this.mode.canCreateNew ) {
|
||||
if (this.mode.templates && this.mode.templates.length) {
|
||||
|
||||
@ -1947,6 +1947,7 @@ define([
|
||||
'<tr><td class="padding-large"><div id="print-combo-sides" style="width: 248px;"></div></td></tr>',
|
||||
'<tr><td><label class="font-weight-bold"><%= scope.txtPaperSize %></label></td></tr>',
|
||||
'<tr><td class="padding-large"><div id="print-combo-pages" style="width: 248px;"></div></td></tr>',
|
||||
'<tr class="header-settings"><td class="padding-large"><label class="link" id="print-header-footer-settings" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium"><%= scope.txtHeaderFooterSettings %></label></td></tr>',
|
||||
'<tr class="fms-btn-apply"><td>',
|
||||
'<div class="footer justify">',
|
||||
'<button id="print-btn-print" class="btn normal dlg-btn primary margin-right-8" result="print" style="width: 96px;" data-hint="2" data-hint-direction="bottom" data-hint-offset="big"><%= scope.txtPrint %></button>',
|
||||
@ -2143,9 +2144,12 @@ define([
|
||||
});
|
||||
|
||||
this.$el = $(node).html($markup);
|
||||
this.$el.on('click', '#print-header-footer-settings', _.bind(this.openHeaderSettings, this));
|
||||
this.$previewBox = $('#print-preview-box');
|
||||
this.$previewEmpty = $('#print-preview-empty');
|
||||
|
||||
this.applyMode();
|
||||
|
||||
if (_.isUndefined(this.scroller)) {
|
||||
this.scroller = new Common.UI.Scroller({
|
||||
el: this.pnlSettings,
|
||||
@ -2188,6 +2192,13 @@ define([
|
||||
|
||||
setMode: function(mode) {
|
||||
this.mode = mode;
|
||||
!this._initSettings && this.applyMode();
|
||||
},
|
||||
|
||||
applyMode: function() {
|
||||
if (!this.mode || !this.$el) return;
|
||||
this.$el.find('.header-settings')[this.mode.isEdit ? 'show' : 'hide']();
|
||||
// !this.mode.isDesktopApp && this.$el.find('.desktop-settings').hide();
|
||||
},
|
||||
|
||||
setApi: function(api) {
|
||||
@ -2234,6 +2245,10 @@ define([
|
||||
this.cmbPaperSize.setValue(value);
|
||||
},
|
||||
|
||||
openHeaderSettings: function() {
|
||||
this.fireEvent('openheader', this);
|
||||
},
|
||||
|
||||
txtPrint: 'Print',
|
||||
txtPrintPdf: 'Print to PDF',
|
||||
txtPrintRange: 'Print range',
|
||||
@ -2252,7 +2267,8 @@ define([
|
||||
txtOneSideDesc: 'Only print on one side of the page',
|
||||
txtBothSides: 'Print on both sides',
|
||||
txtBothSidesLongDesc: 'Flip pages on long edge',
|
||||
txtBothSidesShortDesc: 'Flip pages on short edge'
|
||||
txtBothSidesShortDesc: 'Flip pages on short edge',
|
||||
txtHeaderFooterSettings: 'Header/footer settings',
|
||||
|
||||
}, PE.Views.PrintWithPreview || {}));
|
||||
});
|
||||
|
||||
@ -406,6 +406,7 @@ define(['text!presentationeditor/main/app/template/HeaderFooterDialog.template',
|
||||
this.slideprops = new AscCommonSlide.CAscHFProps();
|
||||
this.notesprops = new AscCommonSlide.CAscHFProps();
|
||||
}
|
||||
(this.type == 1) ? this.btnNotes.toggle(true) : this.btnSlide.toggle(true);
|
||||
this.ShowHideElem();
|
||||
this.fillHFSettings();
|
||||
},
|
||||
|
||||
@ -2173,6 +2173,7 @@
|
||||
"PE.Views.PrintWithPreview.txtPrintPdf": "Print to PDF",
|
||||
"PE.Views.PrintWithPreview.txtPrintRange": "Print range",
|
||||
"PE.Views.PrintWithPreview.txtPrintSides": "Print sides",
|
||||
"PE.Views.PrintWithPreview.txtHeaderFooterSettings": "Header/footer settings",
|
||||
"PE.Views.RightMenu.txtChartSettings": "Chart settings",
|
||||
"PE.Views.RightMenu.txtImageSettings": "Image settings",
|
||||
"PE.Views.RightMenu.txtParagraphSettings": "Paragraph settings",
|
||||
|
||||
Reference in New Issue
Block a user