Also convert ES6 to ES5 syntax while we're at it.
Fixes: #5476
Fixes: 5b42cd5b46
("luci-mod-system: move default option from defaul-on trigger to none trigger")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
22 lines
540 B
JavaScript
22 lines
540 B
JavaScript
'use strict';
|
|
'require form';
|
|
'require baseclass';
|
|
|
|
return baseclass.extend({
|
|
trigger: _('Always off (kernel: none)'),
|
|
description: _('The LED is always in default state off.'),
|
|
kernel: true,
|
|
addFormOptions: function(s) {
|
|
var o;
|
|
|
|
o = s.option(form.Flag, 'default', _('Default state'));
|
|
o.rmempty = false;
|
|
o.depends('trigger', 'none');
|
|
o.textvalue = function(section_id) {
|
|
var cval = this.cfgvalue(section_id);
|
|
if (cval == null)
|
|
cval = this.default;
|
|
return (cval == this.enabled) ? _('On') : _('Off');
|
|
};
|
|
}
|
|
});
|