[DE] Bug 43059 ( Margins Dialog)

This commit is contained in:
Julia Svinareva 2019-11-28 12:01:45 +03:00
parent 026233f10e
commit 3b2f238f0d
2 changed files with 30 additions and 1 deletions

View file

@ -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;
},

View file

@ -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",