vocalizer icon indicating copy to clipboard operation
vocalizer copied to clipboard

Initializing dynamically

Open DieterHolvoet opened this issue 9 years ago • 3 comments

Hi, Could you make it possible to somehow load new instances dynamically, instead of only on page load? For example, by exposing a function that accepts an element.

DieterHolvoet avatar Jan 04 '17 14:01 DieterHolvoet

Alternatively (or in addition), event delegating allows this feature to be implemented transparently, no API needed. And if you're worried about performance you can add a data-vocalizer-event-source attribute (or something like that) that causes vocalizer.js to bind event listeners to those elements instead of document.

I've actually done some work with event delegation before, and I'd be happy to implement the feature if the maintainer is interested.

mikayla-maki avatar Jan 04 '17 19:01 mikayla-maki

@DieterHolvoet Yes, definitely!

@MakiCode That would be great. I will be adding the un-minified source to the repo later on today. Thanks.

atifazam avatar Jan 05 '17 15:01 atifazam

@MakiCode I just added the source files - feel free to submit PRs :)

atifazam avatar Jan 09 '17 02:01 atifazam