Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal ticker fail #117

Closed
jessepinuelas opened this issue Apr 4, 2012 · 6 comments
Closed

Internal ticker fail #117

jessepinuelas opened this issue Apr 4, 2012 · 6 comments
Assignees
Milestone

Comments

@jessepinuelas
Copy link

I have implemented the reel and it is working great, but I have this problem I was hoping someone can assist me with. I click on a thumbnail and it displays my 360 in a modal and it works great. But when I close the modal and reopen it I can't seem to scrub or rotate the images again. It still works when I use my mouse wheel or my keyboard left and right button arrows which I have binder but the drag does not work after closing my modal and reopening it.

I was wondering if it had anything to do with the unbinding of events from the pool on line 438 or the teardown function on line 211. Any help would be greatly appreciated.

@sametjan
Copy link

sametjan commented Apr 5, 2012

If you clear out the $.reel.instances array, and then call reel on the element again, it will re-enable the drag.

@jessepinuelas
Copy link
Author

Makes sense, the reel instance was not being reset.

@pisi
Copy link
Owner

pisi commented Apr 5, 2012

@jessepinuelas did @merlin903's suggestion work for you?

I've put together a test case fiddle confirming everything you reported. I even included all known ways to "reset" Reel, but none of them does it. I followed my suspicion about ticker no being properly restarted when leader instance appears in the document again. So I configured some animation and added a ticker tracker, which plants ticks below the image. That confirmed that the ticker never resumes its operation when the modal is shown, hidden and shown again.

@pisi pisi reopened this Apr 5, 2012
@pisi
Copy link
Owner

pisi commented Apr 5, 2012

Some notes for me:

  1. As the last Reel instance disappears from DOM, it correctly yields a null tempo, which in turn stops the ticker. However it doesn't clear the timeout id in the ticker private var. As there is another ticker local var inside the tick scope, the outer ticker is inaccessible for the clearing.
  2. When the instance is removed abruptly by simply emptying its context, the now orphan DOM fragment is not removed from $.reel.instances jQuery and by being the oldest one, it takes the leader role, but with null tempo, which stops the ticker again.

pisi added a commit that referenced this issue Apr 6, 2012
pisi added a commit that referenced this issue Apr 6, 2012
…ed. It is being called internally by every relevant DOM destroyer. The wrapper triggers `"clean"` handler. #117
pisi added a commit that referenced this issue Apr 6, 2012
… automatically after instance being removed from the DOM. #117
pisi added a commit that referenced this issue Apr 6, 2012
@pisi
Copy link
Owner

pisi commented Apr 6, 2012

It should be fixed now in the development branch. The working is backed up by tests, but still I updated the fiddle:

http://jsfiddle.net/FeeDy/3/

I removed the workaround attempts from there and made it link the development version code from github directly. Please confirm the new code is working well in the fiddle and also for you in your application.

@ghost ghost assigned pisi Apr 6, 2012
@pisi
Copy link
Owner

pisi commented May 7, 2012

@jessepinuelas, can you please confirm this issue you reported is gone from the current development branch?

@pisi pisi closed this as completed May 7, 2012
pisi added a commit that referenced this issue Jul 16, 2012
========

Lovely new features:
* in-picture annotations
* new image preloading method
* frame by frame stepping
* new data change model
* full documentation
* jQuery 1.5+

New options:
* `annotations`, `attr`, `cursor`, `steppable`, improved `images`

New events:
* `stepLeft`, `stepRight`, `openingDone`, improved `play`

New methods:
* `.unreel()`, improved `.reel()`

Includes fixes for issues #10, #20, #36, #51, #62, #64, #65, #69, #103, #110, #111, #113, #115, #117, #122, #124, #125, #126

Enjoy!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants