ucla-oarc-mobile / mwf

UCLA Mobile Web Framework
http://mwf.ucla.edu
Other
86 stars 25 forks source link

Touch Transitions Library: jSwipe Plugin Never Loads #143

Closed loganfranken closed 12 years ago

loganfranken commented 12 years ago

I realize that the current Touch Transitions library (https://github.com/ucla/mwf/wiki/API%3A-JS%3A-Touch-Transitions) is in flux, but it appears that the code for the jQuery plug-in (jSwipe) used by the transitions library is wrapped in a document.addEventListener('load', function() { }), which will never get called because the load event on the document object is deprecated in most browsers (http://my.opera.com/hallvors/blog/2009/05/20/the-day-supporting-document-onload-became-a-bug).

Seems like the easiest fix would be to just remove addEventListener and let the plug-in initialize itself as soon as it gets imported to the page. I can put together the fix, but I was just wondering:

ebollens commented 12 years ago

Logan,

These should clear up your questions:

Would you like to take a pass at this or should we queue it up? The fix should be to MWF 1.2 branch and then we'll port it over to MWF 1.3.

loganfranken commented 12 years ago

Thanks Eric! I'll put together the fix a little later today.

ebollens commented 12 years ago

Thanks Logan. Assigning this over to you then.

Trott commented 12 years ago

Note that there are two places in the framework where document.addEventListener('load',...) is called where window.addEventListener('load',...) is meant. The first is in the jquery swipe stuff. The second is in preview_menu.src.js/preview_menu.js.

loganfranken commented 12 years ago

Since it was such a trivial change, I went ahead and pulled in the change from my repo. I hope that was alright (but let me know if it wasn't!)

ebollens commented 12 years ago

You can push/pull for exactly that reason :) Thank you!

On May 13, 2012, at 6:03 PM, "Logan Franken" reply@reply.github.com wrote:

Since it was such a trivial change, I went ahead and pulled in the change from my repo. I hope that was alright (but let me know if it wasn't!)


Reply to this email directly or view it on GitHub: https://github.com/ucla/mwf/issues/143#issuecomment-5681057