Closed slavap closed 10 years ago
Yeah, i actually did this to get rid of the ugly eval. I'll give this some more thought - fwiw, I found that to send in a function in data-options, it's much easier to name the function rather than create an anonymous function...
http://dev.jtsage.com/jQM-DateBox/doc/6-1-callback/ shows how I usually do it. of course, if you are building the function on the fly (i.e. serverside, this becomes a bit more difficult)
I don't like evals, but in some cases it's convenient to define function right in data-options. It's up to you, I'm OK with adding special function to window and then use its name.
In previous version 1.4.2 the code was:
Now in version 1.4.4 it's:
Because o.openCallback = new Function(o.openCallback) is removed, my code is not working anymore, and now there is no way how I can define openCallback through data-options attribute. Please return back 'new Function(o.openCallback)' functionality. The same applies to closeCallback as well.