Sha256: 58dbd5f4500d0d85324e6cb99deca8d326c0bf31bd263d68de6939fde4c9dde7

Contents?: true

Size: 831 Bytes

Versions: 5

Compression:

Stored size: 831 Bytes

Contents

include('toggleButton.js');

uki.view.declare('uki.more.view.RadioButton', uki.more.view.ToggleButton, function(base) {
    var manager = uki.view.Radio;
    
    this.group = uki.newProp('_group', function(g) {
        manager.unregisterGroup(this);
        this._group = g;
        manager.registerGroup(this);
        manager.clearGroup(this);
    });
    
    this.value = this.checked = uki.newProp('_checked', function(state) {
        this._checked = !!state;
        if (state) manager.clearGroup(this);
        this._updateBg();
    });
    
    this._mouseup = function() {
        if (!this._down) return;
        this._down = false;
        if (!this._checked && !this._disabled) {
            this.checked(!this._checked);
            this.trigger('change', {checked: this._checked, source: this});
        }
    }
});

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
uki-1.1.1 frameworks/uki/src/uki-more/more/view/radioButton.js
uki-1.1.0 frameworks/uki/src/uki-more/more/view/radioButton.js
uki-1.0.2 frameworks/uki/src/uki-more/more/view/radioButton.js
uki-1.0.1 frameworks/uki/src/uki-more/more/view/radioButton.js
uki-1.0.0 frameworks/uki/src/uki-more/more/view/radioButton.js