[de] Add edit of first line of the paragraph
This commit is contained in:
parent
0fc75a9ab5
commit
2592bffef1
|
@ -54,6 +54,7 @@ define([
|
|||
var _stack = [],
|
||||
_paragraphInfo = {},
|
||||
_paragraphObject = undefined,
|
||||
_paragraphProperty = undefined,
|
||||
_styles = [],
|
||||
_styleThumbSize,
|
||||
_styleName,
|
||||
|
@ -113,6 +114,7 @@ define([
|
|||
|
||||
$('#paragraph-distance-before .button').single('click', _.bind(me.onDistanceBefore, me));
|
||||
$('#paragraph-distance-after .button').single('click', _.bind(me.onDistanceAfter, me));
|
||||
$('#paragraph-spin-first-line .button').single('click', _.bind(me.onSpinFirstLine, me));
|
||||
$('#paragraph-space input:checkbox').single('change', _.bind(me.onSpaceBetween, me));
|
||||
$('#paragraph-page-break input:checkbox').single('change', _.bind(me.onBreakBefore, me));
|
||||
$('#paragraph-page-orphan input:checkbox').single('change', _.bind(me.onOrphan, me));
|
||||
|
@ -127,6 +129,23 @@ define([
|
|||
initSettings: function () {
|
||||
var me = this;
|
||||
|
||||
var selectedElements = me.api.getSelectedElements();
|
||||
if (selectedElements && _.isArray(selectedElements)) {
|
||||
for (var i = selectedElements.length - 1; i >= 0; i--) {
|
||||
if (Asc.c_oAscTypeSelectElement.Paragraph == selectedElements[i].get_ObjectType()) {
|
||||
_paragraphProperty = selectedElements[i].get_ObjectValue();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_paragraphProperty) {
|
||||
if (_paragraphProperty.get_Ind()===null || _paragraphProperty.get_Ind()===undefined) {
|
||||
_paragraphProperty.get_Ind().put_FirstLine(0);
|
||||
}
|
||||
$('#paragraph-spin-first-line .item-after label').text(_paragraphProperty.get_Ind().get_FirstLine() + ' ' + 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());
|
||||
|
@ -236,12 +255,22 @@ define([
|
|||
} else {
|
||||
distance = Math.min(100, ++distance);
|
||||
}
|
||||
},
|
||||
|
||||
_paragraphInfo.spaceAfter = distance;
|
||||
onSpinFirstLine: function(e) {
|
||||
var $button = $(e.currentTarget),
|
||||
distance = _paragraphProperty.get_Ind().get_FirstLine();
|
||||
|
||||
$('#paragraph-distance-after .item-after label').text(_paragraphInfo.spaceAfter < 0 ? 'Auto' : (_paragraphInfo.spaceAfter) + ' ' + metricText);
|
||||
if ($button.hasClass('decrement')) {
|
||||
distance = Math.max(-999, --distance);
|
||||
} else {
|
||||
distance = Math.min(999, ++distance);
|
||||
}
|
||||
|
||||
this.api.put_LineSpacingBeforeAfter(1, (_paragraphInfo.spaceAfter < 0) ? -1 : Common.Utils.Metric.fnRecalcToMM(_paragraphInfo.spaceAfter));
|
||||
_paragraphProperty.get_Ind().put_FirstLine(distance)
|
||||
|
||||
$('#paragraph-spin-first-line .item-after label').text(distance + ' ' + metricText);
|
||||
this.api.paraApply(_paragraphProperty);
|
||||
},
|
||||
|
||||
onSpaceBetween: function (e) {
|
||||
|
|
|
@ -92,6 +92,21 @@
|
|||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="paragraph-spin-first-line">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textFirstLine %></div>
|
||||
<div class="item-after splitter">
|
||||
<% if (!android) { %><label><%= scope.textAuto %></label><% } %>
|
||||
<p class="buttons-row">
|
||||
<span class="button decrement no-ripple"><% if (android) { %><i class="icon icon-expand-down"></i><% } else { %>-<% } %></span>
|
||||
<% if (android) { %><label><%= scope.textAuto %></label><% } %>
|
||||
<span class="button increment no-ripple"><% if (android) { %><i class="icon icon-expand-up"></i><% } else { %>+<% } %></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="list-block">
|
||||
|
|
|
@ -165,6 +165,7 @@ define([
|
|||
textFromText: 'Distance from Text',
|
||||
textBefore: 'Before',
|
||||
textAuto: 'Auto',
|
||||
textFirstLine: 'First Line',
|
||||
textAfter: 'After',
|
||||
textSpaceBetween: 'Space Between Paragraphs',
|
||||
textPageBreak: 'Page Break Before',
|
||||
|
|
|
@ -273,6 +273,7 @@
|
|||
"DE.Views.EditParagraph.textAdvSettings": "Дополнительно",
|
||||
"DE.Views.EditParagraph.textAfter": "После",
|
||||
"DE.Views.EditParagraph.textAuto": "Авто",
|
||||
"DE.Views.EditParagraph.textFirstLine": "Первоя строка",
|
||||
"DE.Views.EditParagraph.textBack": "Назад",
|
||||
"DE.Views.EditParagraph.textBackground": "Фон",
|
||||
"DE.Views.EditParagraph.textBefore": "Перед",
|
||||
|
|
Loading…
Reference in a new issue