From 4a43eaa15158f6530be9f913568995a779b8ee61 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 18 Jan 2018 14:14:33 +0300 Subject: [PATCH] [DE] Change settings for header/footer: page numbering. --- .../template/HeaderFooterSettings.template | 84 +++++++++++----- .../main/app/view/HeaderFooterSettings.js | 96 ++++++++++++++++++- apps/documenteditor/main/locale/en.json | 6 ++ 3 files changed, 155 insertions(+), 31 deletions(-) diff --git a/apps/documenteditor/main/app/template/HeaderFooterSettings.template b/apps/documenteditor/main/app/template/HeaderFooterSettings.template index f540f29c5..d1a480419 100644 --- a/apps/documenteditor/main/app/template/HeaderFooterSettings.template +++ b/apps/documenteditor/main/app/template/HeaderFooterSettings.template @@ -1,28 +1,4 @@ - - - - - - - - - - - - - @@ -55,9 +31,65 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- -
-
-
-
-
-
-
-
-
-
-
@@ -40,7 +16,7 @@
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+
+
+
\ No newline at end of file diff --git a/apps/documenteditor/main/app/view/HeaderFooterSettings.js b/apps/documenteditor/main/app/view/HeaderFooterSettings.js index c1b986128..8a40e8e92 100644 --- a/apps/documenteditor/main/app/view/HeaderFooterSettings.js +++ b/apps/documenteditor/main/app/view/HeaderFooterSettings.js @@ -45,7 +45,8 @@ define([ 'backbone', 'common/main/lib/component/Button', 'common/main/lib/component/MetricSpinner', - 'common/main/lib/component/CheckBox' + 'common/main/lib/component/CheckBox', + 'common/main/lib/component/RadioBox' ], function (menuTemplate, $, _, Backbone) { 'use strict'; @@ -72,7 +73,9 @@ define([ DiffFirst: false, DiffOdd: false, SameAs: false, - DisabledControls: false + DisabledControls: false, + Numbering: true, + From: 1 }; this.spinners = []; this.lockedControls = []; @@ -129,10 +132,23 @@ define([ value = prop.get_LinkToPrevious(); if ( this._state.SameAs!==value ) { - this.chSameAs.setDisabled(value===null); + this.chSameAs.setDisabled(value===null || this._locked); this.chSameAs.setValue(value==true, true); this._state.SameAs=value; } + + // value = prop.get_PageNumbering(); + if ( this._state.Numbering!==value ) { + this.radioPrev.setValue(!!value); + this.radioFrom.setValue(!value); + this._state.Numbering=value; + } + + // value = prop.get_NumberingFrom(); + if ( this._state.From!==value ) { + this.numFrom.setValue(value===null ? '' : value); + this._state.From=value; + } } }, @@ -166,6 +182,36 @@ define([ this.fireEvent('editcomplete', this); }, + onInsertCurrentClick: function() { + if (this.api) + this.api.put_PageNum(-1); + this.fireEvent('editcomplete', this); + }, + + onRadioPrev: function(field, newValue, eOpts) { + if (newValue && this.api) { + // this.api.HeadersAndFooters_FromPrevious(newValue); + } + this.fireEvent('editcomplete', this); + }, + + onRadioFrom: function(field, newValue, eOpts) { + if (newValue && this.api) { + if (_.isEmpty(this.numFrom.getValue())) + this.numFrom.setValue(1); + // this.api.HeadersAndFooters_From(this.numFrom.getNumberValue()); + } + this.fireEvent('editcomplete', this); + }, + + onNumFromChange: function(field, newValue, oldValue, eOpts){ + if (this.api) { + this.radioFrom.setValue(true); + // this.api.HeadersAndFooters_From(field.getNumberValue()); + } + this.fireEvent('editcomplete', this); + }, + updateMetricUnit: function() { if (this.spinners) { for (var i=0; i