HanSolo / SteelSeries-Canvas

The HTML5 Canvas port of the SteelSeries component library. Mainly contains gauges.
120 stars 76 forks source link

Add ability to pass host element as DOM object, not just text ID #8

Closed BrandonLWhite closed 10 years ago

BrandonLWhite commented 10 years ago

At present you can only pass textual IDs of host elements when creating a gauge component. This makes it difficult to use the library in modern "ID-less" development paradigms where no elements are given any sort of ID. In particular, it impedes creation of MVVM databindings for things like Knockout.js. I'm sure there are other use cases where you would want to pass an DOM element object, like for instance the result of a jQuery selector or and element created in code,

mcrossley commented 10 years ago

Merged in Brandon's changes, you can now pass either an ID string or a canvas object on creation - v0.14.5