[DE] Added tab leader.

This commit is contained in:
Julia Radzhabova 2017-11-03 16:23:19 +03:00
parent a5c938338f
commit 4bfd4bf211
3 changed files with 50 additions and 29 deletions

View file

@ -139,12 +139,15 @@
<div class="padding-large">
<div id="paraadv-list-tabs" style="width:180px; height: 94px;"></div>
</div>
<div class="padding-large" >
<label class="input-label padding-small" style="display: block;"><%= scope.textAlign %></label>
<div id="paragraphadv-radio-left" class="padding-small" style="display: block;"></div>
<div id="paragraphadv-radio-center" class="padding-small" style="display: block;"></div>
<div id="paragraphadv-radio-right" style="display: block;"></div>
<div class="padding-large" style="display: inline-block;margin-right: 7px;">
<label class="input-label"><%= scope.textAlign %></label>
<div id="paraadv-cmb-align"></div>
</div>
<div class="padding-large" style="display: inline-block;">
<label class="input-label"><%= scope.textLeader %></label>
<div id="paraadv-cmb-leader"></div>
</div>
<div style="margin-bottom: 45px;"></div>
<div>
<button type="button" class="btn btn-text-default" id="paraadv-button-add-tab" style="width:90px;margin-right: 4px;"><%= scope.textSet %></button>
<button type="button" class="btn btn-text-default" id="paraadv-button-remove-tab" style="width:90px;margin-right: 4px;"><%= scope.textRemove %></button>

View file

@ -42,7 +42,6 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
'common/main/lib/view/AdvancedSettingsWindow',
'common/main/lib/component/MetricSpinner',
'common/main/lib/component/CheckBox',
'common/main/lib/component/RadioBox',
'common/main/lib/component/ThemeColorPalette',
'common/main/lib/component/ColorButton',
'common/main/lib/component/ListView',
@ -410,24 +409,35 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
this.listenTo(this.tabList.store, 'remove', storechanged);
this.listenTo(this.tabList.store, 'reset', storechanged);
this.radioLeft = new Common.UI.RadioBox({
el: $('#paragraphadv-radio-left'),
labelText: this.textTabLeft,
name: 'asc-radio-tab',
checked: true
this.cmbAlign = new Common.UI.ComboBox({
el : $('#paraadv-cmb-align'),
style : 'width: 85px;',
menuStyle : 'min-width: 85px;',
editable : false,
cls : 'input-group-nr',
data : [
{ value: 1, displayValue: this.textTabLeft },
{ value: 3, displayValue: this.textTabCenter },
{ value: 2, displayValue: this.textTabRight }
]
});
this.cmbAlign.setValue(1);
this.radioCenter = new Common.UI.RadioBox({
el: $('#paragraphadv-radio-center'),
labelText: this.textTabCenter,
name: 'asc-radio-tab'
});
this.radioRight = new Common.UI.RadioBox({
el: $('#paragraphadv-radio-right'),
labelText: this.textTabRight,
name: 'asc-radio-tab'
this.cmbLeader = new Common.UI.ComboBox({
el : $('#paraadv-cmb-leader'),
style : 'width: 85px;',
menuStyle : 'min-width: 85px;',
editable : false,
cls : 'input-group-nr',
data : [
{ value: Asc.c_oAscTabLeader.None, displayValue: this.textNone },
{ value: Asc.c_oAscTabLeader.Dot, displayValue: '....................' },
{ value: Asc.c_oAscTabLeader.Hyphen, displayValue: '-----------------' },
{ value: Asc.c_oAscTabLeader.MiddleDot, displayValue: '·················' },
{ value: Asc.c_oAscTabLeader.Underscore,displayValue: '__________' }
]
});
this.cmbLeader.setValue(Asc.c_oAscTabLeader.None);
this.btnAddTab = new Common.UI.Button({
el: $('#paraadv-button-add-tab')
@ -562,7 +572,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
if (this._changedProps.get_Tabs()===null || this._changedProps.get_Tabs()===undefined)
this._changedProps.put_Tabs(new Asc.asc_CParagraphTabs());
this.tabList.store.each(function (item, index) {
var tab = new Asc.asc_CParagraphTab(Common.Utils.Metric.fnRecalcToMM(item.get('tabPos')), item.get('tabAlign'));
var tab = new Asc.asc_CParagraphTab(Common.Utils.Metric.fnRecalcToMM(item.get('tabPos')), item.get('tabAlign'), item.get('tabLeader'));
this._changedProps.get_Tabs().add_Tab(tab);
}, this);
}
@ -663,7 +673,8 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
rec.set({
tabPos: pos,
value: parseFloat(pos.toFixed(3)) + ' ' + Common.Utils.Metric.getCurrentMetricName(),
tabAlign: tab.get_Value()
tabAlign: tab.get_Value(),
tabLeader: tab.asc_getLeader()
});
arr.push(rec);
}
@ -1054,8 +1065,9 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
},
addTab: function(btn, eOpts){
var val = this.numTab.getNumberValue();
var align = this.radioLeft.getValue() ? 1 : (this.radioCenter.getValue() ? 3 : 2);
var val = this.numTab.getNumberValue(),
align = this.cmbAlign.getValue(),
leader = this.cmbLeader.getValue();
var store = this.tabList.store;
var rec = store.find(function(record){
@ -1063,13 +1075,15 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
});
if (rec) {
rec.set('tabAlign', align);
rec.set('tabLeader', leader);
this._tabListChanged = true;
} else {
rec = new Common.UI.DataViewModel();
rec.set({
tabPos: val,
value: val + ' ' + Common.Utils.Metric.getCurrentMetricName(),
tabAlign: align
tabAlign: align,
tabLeader: leader
});
store.add(rec);
}
@ -1110,8 +1124,8 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
rawData = record;
}
this.numTab.setValue(rawData.tabPos);
(rawData.tabAlign==1) ? this.radioLeft.setValue(true) : ((rawData.tabAlign==3) ? this.radioCenter.setValue(true) : this.radioRight.setValue(true));
this.cmbAlign.setValue(rawData.tabAlign);
this.cmbLeader.setValue(rawData.tabLeader);
},
hideTextOnlySettings: function(value) {
@ -1173,6 +1187,8 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
tipNone: 'Set No Borders',
tipInner: 'Set Horizontal Inner Lines Only',
tipOuter: 'Set Outer Border Only',
noTabs: 'The specified tabs will appear in this field'
noTabs: 'The specified tabs will appear in this field',
textLeader: 'Leader',
textNone: 'None'
}, DE.Views.ParagraphSettingsAdvanced || {}));
});

View file

@ -1357,6 +1357,8 @@
"DE.Views.ParagraphSettingsAdvanced.tipRight": "Set right border only",
"DE.Views.ParagraphSettingsAdvanced.tipTop": "Set top border only",
"DE.Views.ParagraphSettingsAdvanced.txtNoBorders": "No borders",
"DE.Views.ParagraphSettingsAdvanced.textLeader": "Leader",
"DE.Views.ParagraphSettingsAdvanced.textNone": "None",
"DE.Views.RightMenu.txtChartSettings": "Chart settings",
"DE.Views.RightMenu.txtHeaderFooterSettings": "Header and footer settings",
"DE.Views.RightMenu.txtImageSettings": "Image settings",