Group options of long press action. Closes #48.

This commit is contained in:
Arpad Csanyi
2016-05-20 19:05:17 +02:00
parent c6957107d8
commit 628f07e89c
2 changed files with 67 additions and 32 deletions

View File

@@ -130,7 +130,15 @@
<b class="setting-label" style="position:relative;">Long press action:</b> <b class="setting-label" style="position:relative;">Long press action:</b>
<select class="secondary-role" style="width:135px"> <select class="secondary-role" style="width:135px">
{{#each secondaryRole}} {{#each secondaryRole}}
<option value="{{name}}">{{name}}</option> {{#if groupName}}
<optgroup label="{{groupName}}">
{{/if}}
{{#each groupValues}}
<option value="{{value}}">{{label}}</option>
{{/each}}
{{#if groupName}}
</optgroup>
{{/if}}
{{/each}} {{/each}}
</select> </select>
<i class="fa fa-question-circle" style="margin-left:5px" data-toggle="tooltip" data-placement="right" title="This action happens when the key is being held along with another key."></i> <i class="fa fa-question-circle" style="margin-left:5px" data-toggle="tooltip" data-placement="right" title="This action happens when the key is being held along with another key."></i>

View File

@@ -141,41 +141,68 @@ $(function() {
], ],
secondaryRole: [ secondaryRole: [
{ {
name: 'None' groupName: '',
groupValues: [
{
value: 'None',
label: 'None',
}
]
}, },
{ {
name: 'LShift' groupName: 'Modifiers',
groupValues: [
{
value: 'LShift',
label: 'LShift'
},
{
value: 'LCtrl',
label: 'LCtrl'
},
{
value: 'LSuper',
label: 'LSuper'
},
{
value: 'LAlt',
label: 'LAlt'
},
{
value: 'RAlt',
label: 'RAlt'
},
{
value: 'RSuper',
label: 'RSuper'
},
{
value: 'RCtrl',
label: 'RCtrl'
},
{
value: 'RShift',
label: 'RShift'
}
]
}, },
{ {
name: 'LCtrl' groupName: 'Layer Switcher',
}, groupValues: [
{ {
name: 'LSuper' value: 'Mod',
}, label: 'Mod'
{ },
name: 'LAlt' {
}, value: 'Mouse',
{ label: 'Mouse'
name: 'RAlt' },
}, {
{ value: 'Fn',
name: 'RSuper' label: 'Fn'
}, }
{ ]
name: 'RCtrl' }
},
{
name: 'RShift'
},
{
name: 'Mod'
},
{
name: 'Mouse'
},
{
name: 'Fn'
},
] ]
}, },
macro: { macro: {