render() {
        this.switch_content.innerHTML = this.content
        if (this.disabled) {
            this.switch.classList.add('gus_switch_disabled')
            this.switch_button.classList.add('gus_switch_button_disabled')
            this.switch_button_background.classList.add('gus_switch_button_background_disabled')
            this.switch_content.classList.add('content_disabled')
            this.switch_button.classList.add('gus_switch_button_off')
        }
        else {
            this.switch.classList.remove('gus_switch_disabled')
            this.switch_button.classList.remove('gus_switch_button_disabled')
            this.switch_button_background.classList.remove('gus_switch_button_background_disabled')
            this.switch_content.classList.remove('content_disabled')
            if (!this.checked) {
                this.switch.classList.add('gus_switch_off')
                this.switch_button.classList.add('gus_switch_button_off')
                this.switch_button_background.classList.add('gus_switch_button_background_off')
            }
            else {
                this.switch.classList.remove('gus_switch_off')
                this.switch_button.classList.remove('gus_switch_button_off')
                this.switch_button_background.classList.remove('gus_switch_button_background_off')
            }
        }
    }
// Re-render the whole switch
Re-render the whole switch
Re - render the whole switch
render() {
        this.switch_content.innerHTML = this.content
        if (this.disabled) {
            this.switch.classList.add('gus_switch_disabled')
            this.switch_button.classList.add('gus_switch_button_disabled')
            this.switch_button_background.classList.add('gus_switch_button_background_disabled')
            this.switch_content.classList.add('content_disabled')
            this.switch_button.classList.add('gus_switch_button_off')
        }
        else {
            this.switch.classList.remove('gus_switch_disabled')
            this.switch_button.classList.remove('gus_switch_button_disabled')
            this.switch_button_background.classList.remove('gus_switch_button_background_disabled')
            this.switch_content.classList.remove('content_disabled')
            if (!this.checked) {
                this.switch.classList.add('gus_switch_off')
                this.switch_button.classList.add('gus_switch_button_off')
                this.switch_button_background.classList.add('gus_switch_button_background_off')
            }
            else {
                this.switch.classList.remove('gus_switch_off')
                this.switch_button.classList.remove('gus_switch_button_off')
                this.switch_button_background.classList.remove('gus_switch_button_background_off')
            }
        }
    }
render ( ) { this . switch_content . innerHTML = this . content if ( this . disabled ) { this . switch . classList . add ( 'gus_switch_disabled' ) this . switch_button . classList . add ( 'gus_switch_button_disabled' ) this . switch_button_background . classList . add ( 'gus_switch_button_background_disabled' ) this . switch_content . classList . add ( 'content_disabled' ) this . switch_button . classList . add ( 'gus_switch_button_off' ) } else { this . switch . classList . remove ( 'gus_switch_disabled' ) this . switch_button . classList . remove ( 'gus_switch_button_disabled' ) this . switch_button_background . classList . remove ( 'gus_switch_button_background_disabled' ) this . switch_content . classList . remove ( 'content_disabled' ) if ( ! this . checked ) { this . switch . classList . add ( 'gus_switch_off' ) this . switch_button . classList . add ( 'gus_switch_button_off' ) this . switch_button_background . classList . add ( 'gus_switch_button_background_off' ) } else { this . switch . classList . remove ( 'gus_switch_off' ) this . switch_button . classList . remove ( 'gus_switch_button_off' ) this . switch_button_background . classList . remove ( 'gus_switch_button_background_off' ) } } }
Re-render the whole switch
Re - render the whole switch