Skip to content

Commit

Permalink
- Undo last commit: "Added parameter nextIndex to onLeave callback" #…
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarotrigo committed Apr 23, 2014
1 parent fe1620b commit f99ccf2
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions jquery.fullPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,22 +349,16 @@

//executing only once the first time we reach the section
if(!currentSection.hasClass('active')){
var leavingSectionIndex = $('.section.active').index('.section') + 1;
var leavingSection = $('.section.active').index('.section') + 1;

isScrolling = true;

var yMovement = getYmovement(currentSection);

var anchorLink = currentSection.data('anchor');

var leavingSection = $('.section.active').removeClass('active');
var leavingSectionIndex = leavingSection.index('.section');
var nextSectionIndex = currentSection.index('.section');

currentSection.addClass('active');

currentSection.addClass('active').siblings().removeClass('active');

var anchorLink = currentSection.data('anchor');
$.isFunction( options.onLeave ) && options.onLeave.call( this, leavingSectionIndex, nextSectionIndex, yMovement);
$.isFunction( options.onLeave ) && options.onLeave.call( this, leavingSection, yMovement);

$.isFunction( options.afterLoad ) && options.afterLoad.call( this, anchorLink, (currentSection.index('.section') + 1));

Expand Down Expand Up @@ -669,8 +663,6 @@
var activeSlide = element.find('.slide.active');
var activeSection = $('.section.active');
var leavingSection = activeSection.index('.section') + 1;
var leavingSectionIndex = activeSection.index('.section') + 1;
var nextSectionIndex = element.index('.section') + 1;

//caching the value of isResizing at the momment the function is called
//because it will be checked later inside a setTimeout and the value might change
Expand Down Expand Up @@ -750,7 +742,8 @@
if (options.css3 && options.autoScrolling) {

//callback (onLeave) if the site is not just resizing and readjusting the slides
$.isFunction(options.onLeave) && !localIsResizing && options.onLeave.call(this, leavingSectionIndex, nextSectionIndex, yMovement);
$.isFunction(options.onLeave) && !localIsResizing && options.onLeave.call(this, leavingSection, yMovement);


var translate3d = 'translate3d(0px, -' + dtop + 'px, 0px)';
transformContainer(translate3d, true);
Expand All @@ -770,9 +763,9 @@
} else { // ... use jQuery animate

//callback (onLeave) if the site is not just resizing and readjusting the slides
$.isFunction(options.onLeave) && !localIsResizing && options.onLeave.call(this, leavingSectionIndex, nextSectionIndex, yMovement);
$(scrolledElement).animate(
$.isFunction(options.onLeave) && !localIsResizing && options.onLeave.call(this, leavingSection, yMovement);

$(scrolledElement).animate(
scrollOptions
, options.scrollingSpeed, options.easing, function () {
//fix section order from continuousVertical
Expand Down

0 comments on commit f99ccf2

Please sign in to comment.