From 3b2f238f0dc169af178f4a6105db5cfae96d2701 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Thu, 28 Nov 2019 12:01:45 +0300 Subject: [PATCH] [DE] Bug 43059 ( Margins Dialog) --- .../main/app/view/PageMarginsDialog.js | 20 ++++++++++++++++++- apps/documenteditor/main/locale/en.json | 11 ++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/apps/documenteditor/main/app/view/PageMarginsDialog.js b/apps/documenteditor/main/app/view/PageMarginsDialog.js index 279c5f7fc..a30b935a0 100644 --- a/apps/documenteditor/main/app/view/PageMarginsDialog.js +++ b/apps/documenteditor/main/app/view/PageMarginsDialog.js @@ -205,7 +205,7 @@ define([ //this.api.SetDrawImagePreviewMargins('page-margins-preview', this.properties); } }, this)); - this.spinners.push(this.spnLeft); + this.spinners.push(this.spnGutter); this.cmbGutterPosition = new Common.UI.ComboBox({ el : $('#page-margins-spin-gutter-position'), @@ -260,9 +260,12 @@ define([ if (record.value === 0) { this.window.find('#margin-left-label').html(this.textLeft); this.window.find('#margin-right-label').html(this.textRight); + this.cmbGutterPosition.setDisabled(false); } else { this.window.find('#margin-left-label').html(this.textInside); this.window.find('#margin-right-label').html(this.textOutside); + this.cmbGutterPosition.setValue(0); + this.cmbGutterPosition.setDisabled(true); } if (this.api) { this.properties = (this.properties) ? this.properties : new Asc.CDocumentSectionProps(); @@ -324,6 +327,18 @@ define([ this.spnRight.setValue(Common.Utils.Metric.fnRecalcFromMM(props.get_RightMargin()), true); this.cmbOrientation.setValue(props.get_Orientation()); + this.spnGutter.setValue(Common.Utils.Metric.fnRecalcFromMM(props.get_Gutter()), true); + this.cmbGutterPosition.setValue(props.get_GutterAtTop() ? 1 : 0); + var mirrorMargins = props.get_MirrorMargins(); + this.cmbMultiplePages.setValue(mirrorMargins ? 1 : 0); + + if (mirrorMargins) { + this.window.find('#margin-left-label').html(this.textInside); + this.window.find('#margin-right-label').html(this.textOutside); + this.cmbGutterPosition.setValue(0); + } + this.cmbGutterPosition.setDisabled(mirrorMargins); + if (this.api) { //this.api.SetDrawImagePreviewMargins('page-margins-preview', this.properties); } @@ -337,6 +352,9 @@ define([ props.put_LeftMargin(Common.Utils.Metric.fnRecalcToMM(this.spnLeft.getNumberValue())); props.put_RightMargin(Common.Utils.Metric.fnRecalcToMM(this.spnRight.getNumberValue())); props.put_Orientation(this.cmbOrientation.getValue()); + props.put_Gutter(Common.Utils.Metric.fnRecalcToMM(this.spnGutter.getNumberValue())); + props.put_GutterAtTop(this.cmbGutterPosition.getValue() ? true : false); + props.put_MirrorMargins(this.cmbMultiplePages.getValue() ? true : false); return props; }, diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 3b2bac95c..c39000730 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -1757,6 +1757,17 @@ "DE.Views.PageMarginsDialog.textTop": "Top", "DE.Views.PageMarginsDialog.txtMarginsH": "Top and bottom margins are too high for a given page height", "DE.Views.PageMarginsDialog.txtMarginsW": "Left and right margins are too wide for a given page width", + "DE.Views.PageMarginsDialog.textMultiplePages": "Multiple pages", + "DE.Views.PageMarginsDialog.textGutter": "Gutter", + "DE.Views.PageMarginsDialog.textGutterPosition": "Gutter position", + "DE.Views.PageMarginsDialog.textOrientation": "Orientation", + "DE.Views.PageMarginsDialog.textPreview": "Preview", + "DE.Views.PageMarginsDialog.textPortrait": "Portrait", + "DE.Views.PageMarginsDialog.textLandscape": "Landscape", + "DE.Views.PageMarginsDialog.textMirrorMargins": "Mirror margins", + "DE.Views.PageMarginsDialog.textNormal": "Normal", + "DE.Views.PageMarginsDialog.textInside": "Inside", + "DE.Views.PageMarginsDialog.textOutside": "Outside", "DE.Views.PageSizeDialog.textHeight": "Height", "DE.Views.PageSizeDialog.textPreset": "Preset", "DE.Views.PageSizeDialog.textTitle": "Page Size",