mirror of
https://gitverse.ru/kpa39l/yaru.nixg.ru.git
synced 2026-09-29 09:55:06 +00:00
14 lines
560 B
JavaScript
14 lines
560 B
JavaScript
Friends.CheckboxLabel = new function() {
|
|
this.prefix = 'CheckboxLabel-';
|
|
this.createFromTag = function(element, params) {
|
|
var checkbox = y5.Dom.getDescendant(element, '*', this.prefix + 'Checkbox');
|
|
var text = y5.Dom.getDescendant(element, '*', this.prefix + 'Text');
|
|
|
|
function check(e) {
|
|
checkbox.checked = (y5.Strings.trim(text.value).length > 0);
|
|
}
|
|
y5.Events.create('keyup', check, text, true);
|
|
};
|
|
}
|
|
|
|
y5.require(['Dom', 'Events', 'Strings'], function() {y5.loaded('{Friends}.CheckboxLabel')}); |