[DE mobile] Remove all trailing zeroes in the decimal part in format and paragraph settings
This commit is contained in:
parent
42481b7db9
commit
9c4725cfd3
|
@ -259,10 +259,10 @@ define([
|
|||
me.maxMarginsH = me.localSectionProps.get_H() - 26;
|
||||
me.maxMarginsW = me.localSectionProps.get_W() - 127;
|
||||
|
||||
var top = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_TopMargin())).toFixed(2),
|
||||
bottom = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_BottomMargin())).toFixed(2),
|
||||
left = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_LeftMargin())).toFixed(2),
|
||||
right = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_RightMargin())).toFixed(2);
|
||||
var top = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_TopMargin())).toFixed(2)),
|
||||
bottom = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_BottomMargin())).toFixed(2)),
|
||||
left = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_LeftMargin())).toFixed(2)),
|
||||
right = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_RightMargin())).toFixed(2));
|
||||
|
||||
$('#document-margin-top .item-after label').text(top + ' ' + _metricText);
|
||||
$('#document-margin-bottom .item-after label').text(bottom + ' ' + _metricText);
|
||||
|
@ -321,8 +321,8 @@ define([
|
|||
// Init format
|
||||
$pageSize.find('.item-title').text(_pageSizes[_pageSizesIndex]['caption']);
|
||||
var curMetricName = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()),
|
||||
sizeW = Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][0]).toFixed(2),
|
||||
sizeH = Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][1]).toFixed(2);
|
||||
sizeW = +(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][0]).toFixed(2)),
|
||||
sizeH = +(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][1]).toFixed(2));
|
||||
|
||||
var pageSizeTxt = sizeW + ' ' + curMetricName + ' x ' + sizeH + ' ' + curMetricName;
|
||||
$pageSize.find('.item-subtitle').text(pageSizeTxt);
|
||||
|
@ -564,7 +564,7 @@ define([
|
|||
case 'bottom': me.localSectionProps.put_BottomMargin(marginValue); break;
|
||||
}
|
||||
|
||||
var valueCurrentMetric = parseFloat(Common.Utils.Metric.fnRecalcFromMM(marginValue)).toFixed(2);
|
||||
var valueCurrentMetric = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(marginValue)).toFixed(2));
|
||||
$(Common.Utils.String.format('#document-margin-{0} .item-after label', align)).text(valueCurrentMetric + ' ' + _metricText);
|
||||
|
||||
me.applyPageMarginsIfNeed()
|
||||
|
|
|
@ -144,15 +144,15 @@ define([
|
|||
if (_paragraphProperty.get_Ind()===null || _paragraphProperty.get_Ind()===undefined) {
|
||||
_paragraphProperty.get_Ind().put_FirstLine(0);
|
||||
}
|
||||
var firstLineFix = parseFloat(Common.Utils.Metric.fnRecalcFromMM(_paragraphProperty.get_Ind().get_FirstLine())).toFixed(2);
|
||||
var firstLineFix = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(_paragraphProperty.get_Ind().get_FirstLine())).toFixed(2));
|
||||
$('#paragraph-spin-first-line .item-after label').text(firstLineFix + ' ' + metricText);
|
||||
}
|
||||
|
||||
if (_paragraphObject) {
|
||||
_paragraphInfo.spaceBefore = _paragraphObject.get_Spacing().get_Before() < 0 ? _paragraphObject.get_Spacing().get_Before() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_Spacing().get_Before());
|
||||
_paragraphInfo.spaceAfter = _paragraphObject.get_Spacing().get_After() < 0 ? _paragraphObject.get_Spacing().get_After() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_Spacing().get_After());
|
||||
var distanceBeforeFix = parseFloat(_paragraphInfo.spaceBefore).toFixed(2);
|
||||
var distanceAfterFix = parseFloat(_paragraphInfo.spaceAfter).toFixed(2);
|
||||
var distanceBeforeFix = +(parseFloat(_paragraphInfo.spaceBefore).toFixed(2));
|
||||
var distanceAfterFix = +(parseFloat(_paragraphInfo.spaceAfter).toFixed(2));
|
||||
$('#paragraph-distance-before .item-after label').text(_paragraphInfo.spaceBefore < 0 ? 'Auto' : distanceBeforeFix + ' ' + metricText);
|
||||
$('#paragraph-distance-after .item-after label').text(_paragraphInfo.spaceAfter < 0 ? 'Auto' : distanceAfterFix + ' ' + metricText);
|
||||
|
||||
|
@ -253,7 +253,7 @@ define([
|
|||
distance = Math.min(maxValue, distance + step);
|
||||
}
|
||||
|
||||
var distanceFix = distance.toFixed(2);
|
||||
var distanceFix = +(distance.toFixed(2));
|
||||
|
||||
_paragraphInfo.spaceBefore = distance;
|
||||
|
||||
|
@ -282,7 +282,7 @@ define([
|
|||
distance = Math.min(maxValue, distance + step);
|
||||
}
|
||||
|
||||
var distanceFix = distance.toFixed(2);
|
||||
var distanceFix = +(distance.toFixed(2));
|
||||
|
||||
_paragraphInfo.spaceAfter = distance;
|
||||
|
||||
|
@ -314,7 +314,7 @@ define([
|
|||
distance = Math.min(maxValue, distance + step);
|
||||
}
|
||||
|
||||
var distanceFix = distance.toFixed(2);
|
||||
var distanceFix = +(distance.toFixed(2));
|
||||
|
||||
$('#paragraph-spin-first-line .item-after label').text(distanceFix + ' ' + metricText);
|
||||
|
||||
|
|
Loading…
Reference in a new issue