-
Notifications
You must be signed in to change notification settings - Fork 35
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
SlideFromBelow/SlideFromAbove don't animate & get stuck in original, non-centered position #6
Comments
Hi thanks for reporting this. The "Anchored to header (right)" option works in the example and is using 0.32 : http://www.garethelms.org/demo/backbone-js-modal-dialog/demo.html so it at least works on that page. Can you tell me your browser and version. If you can, a stripped down test page exhibiting the problem would be great. In fact I'm struggling to find in the history the exact code you've quoted! Can you link to the change that is causing the problem? |
Embarrassingly, I looked at previous versions of Modal View here on Github and didn't see the solution I mentioned above either. So this is not a regression from 0.31 to 0.3.2. Umm, there's a good chance that I may have tracked this down on an earlier version and added it to my own local copy. It looks like I replaced lines 374 and 380 with that block of code I mentioned. (Sorry, I neglected to document this, so I don't recall why.) The "anchored to header (right)" option in the demo link works for me too. I'm using Chrome 28.0.1500.95, win7 64bit. Here's some demo code that doesn't do the animate.
|
Ah, think I remember my reasoning for the code. It looks like the slideFromBelow animation works if you add a 'top' value in the css options.
I want my modals to end up in the center of the screen. Since you already do those calculations in your js to center the modal, I figured I would use your calculations instead of re-duplicating them in my code. |
Think I've fixed it. I've put up a test at : http://garethelms.org/demo/backbone-js-modal-dialog/slide-test.html The change I made was to add a null check when assigning animateProperties.top eg;
The changes are on line 374 and 380 here : http://garethelms.org/demo/backbone-js-modal-dialog/Backbone.ModalDialog.debug.js Let me know if that fixes it for you in your web app and I'll update the repo. Cheers |
Looks good! |
Worked in 0.31. No longer working in 0.3.2
Looked at diffs. It looks like the following if statement was removed from the ShowModal function, when either SlideFromBelow or SlideFromAbove options are true.
When I add this condition back, animation works again.
The text was updated successfully, but these errors were encountered: