Finished editing documenteditor
This commit is contained in:
parent
8c8a562637
commit
10b2d8e5b2
|
@ -99,9 +99,9 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
|
||||||
this.CurLineRuleIdx = this._originalProps.get_Spacing().get_LineRule();
|
this.CurLineRuleIdx = this._originalProps.get_Spacing().get_LineRule();
|
||||||
|
|
||||||
this._arrLineRule = [
|
this._arrLineRule = [
|
||||||
{displayValue: this.textAtLeast,defaultValue: 4.24, value: c_paragraphLinerule.LINERULE_LEAST, minValue: 0.03, step: 0.01, defaultUnit: 'pt'},
|
{displayValue: this.textAtLeast,defaultValue: 4.24, value: c_paragraphLinerule.LINERULE_LEAST, minValue: 0.03, step: 1, defaultUnit: 'pt'},
|
||||||
{displayValue: this.textAuto, defaultValue: 1, value: c_paragraphLinerule.LINERULE_AUTO, minValue: 0.5, step: 0.01, defaultUnit: ''},
|
{displayValue: this.textAuto, defaultValue: 1, value: c_paragraphLinerule.LINERULE_AUTO, minValue: 0.5, step: 0.01, defaultUnit: ''},
|
||||||
{displayValue: this.textExact, defaultValue: 4.24, value: c_paragraphLinerule.LINERULE_EXACT, minValue: 0.03, step: 0.01, defaultUnit: 'pt'}
|
{displayValue: this.textExact, defaultValue: 4.24, value: c_paragraphLinerule.LINERULE_EXACT, minValue: 0.03, step: 1, defaultUnit: 'pt'}
|
||||||
];
|
];
|
||||||
|
|
||||||
this._arrSpecial = [
|
this._arrSpecial = [
|
||||||
|
@ -208,7 +208,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
|
||||||
this.Spacing = properties.get_Spacing();
|
this.Spacing = properties.get_Spacing();
|
||||||
}
|
}
|
||||||
var value = field.getNumberValue();
|
var value = field.getNumberValue();
|
||||||
this.Spacing.put_Before(value<0 ? -1 : Common.Utils.Metric.fnRecalcToMM(value));
|
this.Spacing.put_Before(value<0 ? -1 : Common.Utils.Metric.fnRecalcToMM(value, Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
}, this));
|
}, this));
|
||||||
this.spinners.push(this.numSpacingBefore);
|
this.spinners.push(this.numSpacingBefore);
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
|
||||||
this.Spacing = properties.get_Spacing();
|
this.Spacing = properties.get_Spacing();
|
||||||
}
|
}
|
||||||
var value = field.getNumberValue();
|
var value = field.getNumberValue();
|
||||||
this.Spacing.put_After(value<0 ? -1 : Common.Utils.Metric.fnRecalcToMM(value));
|
this.Spacing.put_After(value<0 ? -1 : Common.Utils.Metric.fnRecalcToMM(value, Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
}, this));
|
}, this));
|
||||||
this.spinners.push(this.numSpacingAfter);
|
this.spinners.push(this.numSpacingAfter);
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
|
||||||
step: .01,
|
step: .01,
|
||||||
width: 85,
|
width: 85,
|
||||||
value: '',
|
value: '',
|
||||||
defaultUnit : "",
|
defaultUnit : "pt",
|
||||||
maxValue: 132,
|
maxValue: 132,
|
||||||
minValue: 0.5
|
minValue: 0.5
|
||||||
});
|
});
|
||||||
|
@ -810,15 +810,15 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
|
||||||
this.numIndentsRight.setValue((props.get_Ind() !== null && props.get_Ind().get_Right() !== null) ? Common.Utils.Metric.fnRecalcFromMM(props.get_Ind().get_Right()) : '', true);
|
this.numIndentsRight.setValue((props.get_Ind() !== null && props.get_Ind().get_Right() !== null) ? Common.Utils.Metric.fnRecalcFromMM(props.get_Ind().get_Right()) : '', true);
|
||||||
|
|
||||||
var value = props.get_Spacing() ? props.get_Spacing().get_Before() : null;
|
var value = props.get_Spacing() ? props.get_Spacing().get_Before() : null;
|
||||||
this.numSpacingBefore.setValue((value !== null) ? (value<0 ? value : Common.Utils.Metric.fnRecalcFromMM(value)) : '', true);
|
this.numSpacingBefore.setValue((value !== null) ? (value<0 ? value : Common.Utils.Metric.fnRecalcFromMM(value, Common.Utils.Metric.c_MetricUnits.pt)) : '', true);
|
||||||
value = props.get_Spacing() ? props.get_Spacing().get_After() : null;
|
value = props.get_Spacing() ? props.get_Spacing().get_After() : null;
|
||||||
this.numSpacingAfter.setValue((value !== null) ? (value<0 ? value : Common.Utils.Metric.fnRecalcFromMM(value)) : '', true);
|
this.numSpacingAfter.setValue((value !== null) ? (value<0 ? value : Common.Utils.Metric.fnRecalcFromMM(value, Common.Utils.Metric.c_MetricUnits.pt)) : '', true);
|
||||||
|
|
||||||
var linerule = props.get_Spacing().get_LineRule();
|
var linerule = props.get_Spacing().get_LineRule();
|
||||||
this.cmbLineRule.setValue((linerule !== null) ? linerule : '', true);
|
this.cmbLineRule.setValue((linerule !== null) ? linerule : '', true);
|
||||||
|
|
||||||
if(props.get_Spacing() !== null && props.get_Spacing().get_Line() !== null) {
|
if(props.get_Spacing() !== null && props.get_Spacing().get_Line() !== null) {
|
||||||
this.numLineHeight.setValue((linerule==c_paragraphLinerule.LINERULE_AUTO) ? props.get_Spacing().get_Line() : Common.Utils.Metric.fnRecalcFromMM(props.get_Spacing().get_Line()), true);
|
this.numLineHeight.setValue((linerule==c_paragraphLinerule.LINERULE_AUTO) ? props.get_Spacing().get_Line() : Common.Utils.Metric.fnRecalcFromMM(props.get_Spacing().get_Line(), Common.Utils.Metric.c_MetricUnits.pt), true);
|
||||||
} else {
|
} else {
|
||||||
this.numLineHeight.setValue('', true);
|
this.numLineHeight.setValue('', true);
|
||||||
}
|
}
|
||||||
|
@ -944,15 +944,20 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
|
||||||
for (var i=0; i<this.spinners.length; i++) {
|
for (var i=0; i<this.spinners.length; i++) {
|
||||||
var spinner = this.spinners[i];
|
var spinner = this.spinners[i];
|
||||||
spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
|
spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
|
||||||
if (spinner.el.id == 'paragraphadv-spin-spacing' || spinner.el.id == 'paragraphadv-spin-position' || spinner.el.id == 'paragraphadv-spin-spacing-before' || spinner.el.id == 'paragraphadv-spin-spacing-after')
|
if (spinner.el.id == 'paragraphadv-spin-spacing' || spinner.el.id == 'paragraphadv-spin-position')
|
||||||
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.01);
|
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.01);
|
||||||
|
else if( spinner.el.id == 'paragraphadv-spin-spacing-before' || spinner.el.id == 'paragraphadv-spin-spacing-after'){
|
||||||
|
|
||||||
|
spinner.setStep(1);
|
||||||
|
spinner.setDefaultUnit( Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.1);
|
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//this._arrLineRule[2].defaultUnit = this._arrLineRule[0].defaultUnit = Common.Utils.Metric.getCurrentMetricName();
|
//this._arrLineRule[2].defaultUnit = this._arrLineRule[0].defaultUnit = Common.Utils.Metric.getCurrentMetricName();
|
||||||
//this._arrLineRule[2].minValue = this._arrLineRule[0].minValue = parseFloat(Common.Utils.Metric.fnRecalcFromMM(0.3).toFixed(2));
|
//this._arrLineRule[2].minValue = this._arrLineRule[0].minValue = parseFloat(Common.Utils.Metric.fnRecalcFromMM(0.3).toFixed(2));
|
||||||
this._arrLineRule[2].step = this._arrLineRule[0].step = (Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt) ? 1 : 0.01;
|
//this._arrLineRule[2].step = this._arrLineRule[0].step = (Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt) ? 1 : 0.01;
|
||||||
if (this.CurLineRuleIdx !== null) {
|
if (this.CurLineRuleIdx !== null) {
|
||||||
this.numLineHeight.setDefaultUnit(this._arrLineRule[this.CurLineRuleIdx].defaultUnit);
|
this.numLineHeight.setDefaultUnit(this._arrLineRule[this.CurLineRuleIdx].defaultUnit);
|
||||||
this.numLineHeight.setStep(this._arrLineRule[this.CurLineRuleIdx].step);
|
this.numLineHeight.setStep(this._arrLineRule[this.CurLineRuleIdx].step);
|
||||||
|
@ -1414,7 +1419,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
|
||||||
if (this.Spacing.get_LineRule() === c_paragraphLinerule.LINERULE_AUTO) {
|
if (this.Spacing.get_LineRule() === c_paragraphLinerule.LINERULE_AUTO) {
|
||||||
this.numLineHeight.setValue(this._arrLineRule[record.value].defaultValue);
|
this.numLineHeight.setValue(this._arrLineRule[record.value].defaultValue);
|
||||||
} else if (this.CurLineRuleIdx === c_paragraphLinerule.LINERULE_AUTO) {
|
} else if (this.CurLineRuleIdx === c_paragraphLinerule.LINERULE_AUTO) {
|
||||||
this.numLineHeight.setValue(Common.Utils.Metric.fnRecalcFromMM(this._arrLineRule[record.value].defaultValue));
|
this.numLineHeight.setValue(Common.Utils.Metric.fnRecalcFromMM(this._arrLineRule[record.value].defaultValue, Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
} else {
|
} else {
|
||||||
this.numLineHeight.setValue(value);
|
this.numLineHeight.setValue(value);
|
||||||
}
|
}
|
||||||
|
@ -1429,9 +1434,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
|
||||||
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
|
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
|
||||||
this.Spacing = properties.get_Spacing();
|
this.Spacing = properties.get_Spacing();
|
||||||
}
|
}
|
||||||
this.Spacing.put_Line((this.cmbLineRule.getValue()==c_paragraphLinerule.LINERULE_AUTO) ? field.getNumberValue() : (field.getNumberValue()* 25.4 / 72.0));
|
this.Spacing.put_Line((this.cmbLineRule.getValue()==c_paragraphLinerule.LINERULE_AUTO) ? field.getNumberValue() : Common.Utils.Metric.fnRecalcToMM(field.getNumberValue(), Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
|
|
||||||
//this.Spacing.put_Line((this.cmbLineRule.getValue()==c_paragraphLinerule.LINERULE_AUTO) ? field.getNumberValue() : Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onSpecialSelect: function(combo, record) {
|
onSpecialSelect: function(combo, record) {
|
||||||
|
|
Loading…
Reference in a new issue