diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/form.js | 11 | ||||
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/ui.js | 3 |
2 files changed, 12 insertions, 2 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/form.js b/modules/luci-base/htdocs/luci-static/resources/form.js index b3133a8d31..917584bb82 100644 --- a/modules/luci-base/htdocs/luci-static/resources/form.js +++ b/modules/luci-base/htdocs/luci-static/resources/form.js @@ -1644,7 +1644,16 @@ var CBIValue = CBIAbstractValue.extend({ if (typeof(this.title) === 'string' && this.title !== '') { optionEl.appendChild(E('label', { 'class': 'cbi-value-title', - 'for': 'widget.cbid.%s.%s.%s'.format(config_name, section_id, this.option) + 'for': 'widget.cbid.%s.%s.%s'.format(config_name, section_id, this.option), + 'click': function(ev) { + var node = ev.currentTarget, + elem = node.nextElementSibling.querySelector('#' + node.getAttribute('for')) || node.nextElementSibling.querySelector('[data-widget-id="' + node.getAttribute('for') + '"]'); + + if (elem) { + elem.click(); + elem.focus(); + } + } }, this.titleref ? E('a', { 'class': 'cbi-title-ref', diff --git a/modules/luci-base/htdocs/luci-static/resources/ui.js b/modules/luci-base/htdocs/luci-static/resources/ui.js index b78a109bf9..0e196df4b0 100644 --- a/modules/luci-base/htdocs/luci-static/resources/ui.js +++ b/modules/luci-base/htdocs/luci-static/resources/ui.js @@ -236,7 +236,8 @@ var UICheckbox = UIElement.extend({ 'name': this.options.name, 'type': 'checkbox', 'value': this.options.value_enabled, - 'checked': (this.value == this.options.value_enabled) ? '' : null + 'checked': (this.value == this.options.value_enabled) ? '' : null, + 'data-widget-id': this.options.id ? 'widget.' + this.options.id : null })); frameEl.appendChild(E('label', { 'for': id })); |