uikit icon indicating copy to clipboard operation
uikit copied to clipboard

inherit from jQuery

Open tj opened this issue 13 years ago • 3 comments

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)

tj avatar Feb 05 '12 16:02 tj

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

http://api.jquery.com/appendTo/

sjonnet19 avatar Feb 05 '12 16:02 sjonnet19

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 avatar Feb 05 '12 16:02 tj

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(...)
    })
}

sjonnet19 avatar Feb 05 '12 17:02 sjonnet19