Browse Source

Add selectedLabel config in Selector Manager

pull/261/head
Artur Arseniev 9 years ago
parent
commit
df44e2c3be
  1. 2
      src/selector_manager/config/config.js
  2. 12
      src/selector_manager/view/ClassTagsView.js

2
src/selector_manager/config/config.js

@ -12,6 +12,8 @@ module.exports = {
// Label for states // Label for states
statesLabel: '- State -', statesLabel: '- State -',
selectedLabel: 'Selected',
// States // States
states: [ states: [
{ name: 'hover', label: 'Hover' }, { name: 'hover', label: 'Hover' },

12
src/selector_manager/view/ClassTagsView.js

@ -26,7 +26,7 @@ module.exports = Backbone.View.extend({
<span id="<%= pfx %>add-tag" class="fa fa-plus"></span> <span id="<%= pfx %>add-tag" class="fa fa-plus"></span>
</div> </div>
<div id="<%= pfx %>sel-help"> <div id="<%= pfx %>sel-help">
<div id="<%= pfx %>label">Selected</div> <div id="<%= pfx %>label"><%= selectedLabel %></div>
<div id="<%= pfx %>sel"></div> <div id="<%= pfx %>sel"></div>
<div style="clear:both"></div> <div style="clear:both"></div>
</div>`), </div>`),
@ -303,11 +303,13 @@ module.exports = Backbone.View.extend({
}, },
render() { render() {
this.$el.html( this.template({ const config = this.config;
label: this.config.label, this.$el.html(this.template({
statesLabel: this.config.statesLabel, selectedLabel: config.selectedLabel,
statesLabel: config.statesLabel,
label: config.label,
pfx: this.pfx, pfx: this.pfx,
ppfx: this.ppfx ppfx: this.ppfx,
})); }));
this.$input = this.$el.find('input#' + this.newInputId); this.$input = this.$el.find('input#' + this.newInputId);
this.$addBtn = this.$el.find('#' + this.addBtnId); this.$addBtn = this.$el.find('#' + this.addBtnId);

Loading…
Cancel
Save