Skip to content

Click event?  #222

Description

@docmcfly

Hello,

IMHO: I personally find this "change" event handling a bit complicated. Wouldn't it be possible for a switch to trigger a "click" on the checkbox?

Then you could simply use the onclick event in the tag.

i have modify the toggle function:

Toggle.prototype.toggle = function () {
		if (this.$element.prop('checked')) this.off()
		else this.on()
		this.$element[0].click()  // <- triggers the onclick event of the <input> tag :)  
	}

Best regards
Clemens

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions