Skip to content

Commit

Permalink
Remove unnecessary variable hasStarted
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremiePat committed Dec 21, 2012
1 parent 8612654 commit 2aea976
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions jQuery.scrollPoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
var up = params.up,
down = params.down,
isIn = false,
element = $(this),
hasStarted = false;
element = $(this);

if (!up && up !== 0) {
up = element.offset().top;
Expand Down Expand Up @@ -72,15 +71,7 @@
isIn = param.isIn = !param.isUp && !param.isDown;

if (oldIn !== isIn) {
if (!hasStarted && isIn) {
hasStarted = true;
triggerEvent("scrollPointEnter", param);
}

if (hasStarted && !isIn) {
hasStarted = false;
triggerEvent("scrollPointLeave", param);
}
triggerEvent("scrollPoint" + (isIn ? "Enter" : "Leave"), param);
}

triggerEvent("scrollPointMove", param);
Expand Down

1 comment on commit 2aea976

@tzi
Copy link
Collaborator

@tzi tzi commented on 2aea976 Dec 22, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a great clean up!

Please sign in to comment.