Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Touch Transitions Library: jSwipe Plugin Never Loads #143

Closed
loganfranken opened this issue May 9, 2012 · 6 comments
Closed

Touch Transitions Library: jSwipe Plugin Never Loads #143

loganfranken opened this issue May 9, 2012 · 6 comments
Assignees
Milestone

Comments

@loganfranken
Copy link
Contributor

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:

  • Is this something we want to fix given the library will be overhauled soon?
  • In which branch should I add the fix?
@ebollens
Copy link
Contributor

ebollens commented May 9, 2012

Logan,

These should clear up your questions:

  • MWF 1.3 will include a number of JS Interactivity libraries (of which unfortunately only expandable/collapsible is yet implemented). They will completely change the way in which touch interaction occurs, so at that point, this will be deprecated - of course, we should still aim to support the only syntax in line with MWF's backwards compatibility objectives. That said, I would say we should indeed seek to patch this.
  • I'm not exactly sure why we're listening on document and not window. That's probably the easiest fix there. For one reason or another, we elected not to use plugin initialization itself, but maybe that works.

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
Copy link
Contributor Author

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

@ebollens
Copy link
Contributor

ebollens commented May 9, 2012

Thanks Logan. Assigning this over to you then.

@ghost ghost assigned loganfranken May 9, 2012
@Trott
Copy link
Contributor

Trott commented May 10, 2012

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 loganfranken mentioned this issue May 14, 2012
@loganfranken
Copy link
Contributor Author

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
Copy link
Contributor

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:
#143 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants