Skip to content

Commit

Permalink
Add "goingBack" info to pageAnimationStart event. Closes senchalabs#132.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkaneda committed Dec 20, 2011
1 parent f0873e6 commit 3044eb1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/jqtouch.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@
}
function doNavigation(fromPage, toPage, animation, goingBack) {

goingBack = goingBack ? goingBack : false;

// Error check for target page
if (toPage === undefined || toPage.length === 0) {
$.fn.unselect();
Expand All @@ -143,8 +145,8 @@
// Position the incoming page so toolbar is at top of viewport regardless of scroll position on from page
// toPage.css('top', window.pageYOffset);

fromPage.trigger('pageAnimationStart', { direction: 'out' });
toPage.trigger('pageAnimationStart', { direction: 'in' });
fromPage.trigger('pageAnimationStart', { direction: 'out', back: goingBack });
toPage.trigger('pageAnimationStart', { direction: 'in', back: goingBack });

if ($.support.animationEvents && animation && jQTSettings.useAnimations) {

Expand Down Expand Up @@ -214,8 +216,8 @@
setHash($currentPage.attr('id'));

// Trigger custom events
toPage.trigger('pageAnimationEnd', {direction:'in', animation:animation});
fromPage.trigger('pageAnimationEnd', {direction:'out', animation:animation});
toPage.trigger('pageAnimationEnd', { direction:'in', animation: animation});
fromPage.trigger('pageAnimationEnd', { direction:'out', animation: animation});
}

return true;
Expand Down

0 comments on commit 3044eb1

Please sign in to comment.