aolarchive / jquery-liveupdate

Other
8 stars 2 forks source link

Make sure loading plugin twice on a page doesn't cause unwanted behavior #2

Open jeremyjannotta opened 12 years ago

jeremyjannotta commented 12 years ago

Technically we should be able to load more than one instance of the widget on the page. We need to test if loading or initializing the plugin twice on a page causes weird behavior, and make sure that variable scoping and event binding is isolated to each instance.

jeremyjannotta commented 12 years ago

Tested the case of initializing the same element twice, like $el.liveBlogLiteUi().liveBlogLiteUi(); which is weird, but caused the liveBlogLiteApi code to duplicate API requests. Added fix in commit https://github.com/aol/liveblog-widget/commit/37b7d4036bb32024c5f9441323720dc247c19fbb that simply prevents the liveBlogLiteApi from initializing twice on the same object. More testing needs to be done though, including testing two unique widget elements on a page.