EddyVerbruggen / cordova-plugin-actionsheet

:clipboard: ActionSheet plugin for Cordova iOS and Android apps
208 stars 72 forks source link

Fix asynchronous injection of html and button click index in ActionSh… #34

Closed nit23uec closed 8 years ago

nit23uec commented 8 years ago

…eetProxy.js

html required body to be there. But if at the time of install of this plugin (which is at the start of loading of html page), body element has not still loaded, then injection of html would fail as was happening in my case. This html should be injected only when show method is called as it is not needed prior to that. Also, in case of loading templates through underscore.js, the template html can replace this injected code if it is injected so early.

btn.onclick event was not binding to the correct button index due to closure issue. So, created a wrapper of an immediate function over the onclick handler.

EddyVerbruggen commented 8 years ago

Sounds great. Didn't have time to test it, but looks good! :+1: