Skip to content


Subversion checkout URL

You can clone with
Download ZIP


inherit from jQuery #28

tj opened this Issue · 3 comments

2 participants

tj commented

not sure if jquery really facilitates this, will have to take a look but it would be nicer to have button.appendTo(something) vs button.el.appendTo(something)


If u mean to expose a helper for appending ur button element onto another element.

tj commented

I just mean inheriting from the jQuery prototype so I don't have to duplicate any of those methods and dont have to make .el public api

@tj tj closed this
@tj tj reopened this

Looking at some of your code, .appendTo would already be available.

this.el = $(html)
this.el = $(this.template)

The $.fn is just really an alias the jquery's prototype. I'm not sure how you might shoe horn your api together with jQuery.

$.fn.button = function (option) {
    return this.each(function () {
        new Button(...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.