Allow optgroups for selects

This commit is contained in:
Keegan
2016-05-28 14:41:45 -07:00
parent 1611599a25
commit 41d38e04a7
3 changed files with 39 additions and 2 deletions
+9 -1
View File
@@ -4,7 +4,15 @@
<span class="value"></span>
<select data-manipulator-target {{each key: attributes}}{{key}}="{{this}}"{{/each}}>
{{each options}}
<option value="{{this.value}}" class="item-select-option">{{this.label}}</option>
{{if Array.isArray(this.value)}}
<optgroup label="{{this.label}}">
{{each this.value}}
<option value="{{this.value}}" class="item-select-option">{{this.label}}</option>
{{/each}}
</optgroup>
{{else}}
<option value="{{this.value}}" class="item-select-option">{{this.label}}</option>
{{/if}}
{{/each}}
</select>
</label>