src/aria/touch/widgets/Slider.js
function (applySwitchMargins) {
            var value;
            var binding = this._binding;
            if (!binding) {
                return;
            }

            value = binding.inside[binding.to];
            if (value == null) {
                value = 0;
            }
            if (value < 0) {
                value = 0;
            }
            if (value > 1) {
                value = 1;
            }
            if (this._isSwitch && applySwitchMargins) {
                if (value >= this._switchThreshold) {
                    value = 1;
                } else {
                    value = 0;
                }
            }
            this._value = value;
            this._storeValue();
        }
function (applySwitchMargins) {
            var value;
            var binding = this._binding;
            if (!binding) {
                return;
            }

            value = binding.inside[binding.to];
            if (value == null) {
                value = 0;
            }
            if (value < 0) {
                value = 0;
            }
            if (value > 1) {
                value = 1;
            }
            if (this._isSwitch && applySwitchMargins) {
                if (value >= this._switchThreshold) {
                    value = 1;
                } else {
                    value = 0;
                }
            }
            this._value = value;
            this._storeValue();
        }
function ( applySwitchMargins ) { var value ; var binding = this . _binding ; if ( ! binding ) { return ; } value = binding . inside [ binding . to ] ; if ( value == null ) { value = 0 ; } if ( value < 0 ) { value = 0 ; } if ( value > 1 ) { value = 1 ; } if ( this . _isSwitch && applySwitchMargins ) { if ( value >= this . _switchThreshold ) { value = 1 ; } else { value = 0 ; } } this . _value = value ; this . _storeValue ( ) ; }
Read the bound value in the data model, ensure it is defined, between 0 and 1, and assign the _value
property.
@param {Boolean} applySwitchMargins Whether or not the value should be set to either 0 or 1 when the widget
is used as a switch
@protected
Read the bound value in the data model ensure it is defined between 0 and 1 and assign the _value property .