Skip to content

Commit

Permalink
Bumped version number
Browse files Browse the repository at this point in the history
  • Loading branch information
d-oliveros committed Oct 20, 2015
1 parent 1a132ff commit 93834ad
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngSmoothScroll",
"version": "1.7.3",
"version": "1.7.4",
"homepage": "https://github.com/d-oliveros/ngSmoothScroll",
"authors": [
"David Oliveros <[email protected]>"
Expand Down
24 changes: 12 additions & 12 deletions dist/angular-smooth-scroll.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 22 additions & 22 deletions lib/angular-smooth-scroll.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* Angular Smooth Scroll (ngSmoothScroll)
* Animates scrolling to elements, by David Oliveros.
*
*
* Callback hooks contributed by Ben Armston https://github.com/benarmston
* Easing support contributed by Willem Liu. https://github.com/willemliu
* Easing functions forked from Gaëtan Renaudeau. https://gist.github.com/gre/1650294
Expand All @@ -10,7 +10,7 @@
* Influenced by Chris Ferdinandi
* https://github.com/cferdinandi
*
* Version: 1.7.3
* Version: 1.7.4
* License: MIT
*/

Expand All @@ -22,13 +22,13 @@

/**
* Smooth scrolls the window/div to the provided element.
*
*
* 20150713 EDIT - zephinzer
* Added new option - containerId to account for scrolling within a DIV
*/
var smoothScroll = function (element, options) {
options = options || {};

// Options
var duration = options.duration || 800,
offset = options.offset || 0,
Expand All @@ -37,7 +37,7 @@
callbackAfter = options.callbackAfter || function() {},
container = document.getElementById(options.containerId) || null,
containerPresent = (container != undefined && container != null);

/**
* Retrieve current location
*/
Expand All @@ -52,10 +52,10 @@
}
}
};

/**
* Calculate easing pattern.
*
*
* 20150713 edit - zephinzer
* - changed if-else to switch
* @see http://archive.oreilly.com/pub/a/server-administration/excerpts/even-faster-websites/writing-efficient-javascript.html
Expand All @@ -77,7 +77,7 @@
default: return time;
}
};

/**
* Calculate how far to scroll
*/
Expand All @@ -92,15 +92,15 @@
location = Math.max(location - offset, 0);
return location;
};

// Initialize the whole thing
setTimeout( function() {
var currentLocation = null,
startLocation = getScrollLocation(),
endLocation = getEndLocation(element),
timeLapsed = 0,
distance = endLocation - startLocation,
percentage,
percentage,
position,
scrollHeight,
internalHeight;
Expand All @@ -117,17 +117,17 @@
scrollHeight = document.body.scrollheight;
internalHeight = window.innerHeight + currentLocation;
}
if (

if (
( // condition 1
position == endLocation
) ||
) ||
( // condition 2
currentLocation == endLocation
) ||
) ||
( // condition 3
internalHeight >= scrollHeight
)
internalHeight >= scrollHeight
)
) { // stop
clearInterval(runAnimation);
callbackAfter(element);
Expand Down Expand Up @@ -161,11 +161,11 @@
module.factory('smoothScroll', function() {
return smoothScroll;
});


/**
* Scrolls the window to this element, optionally validating an expression
*
*
* 20150713 EDIT - zephinzer
* Added containerId to attributes for smooth scrolling within a DIV
*/
Expand Down Expand Up @@ -217,7 +217,7 @@
* Scrolls to a specified element ID when this element is clicked
*
* 20150713 EDIT - zephinzer
* Added containerId to attributes for smooth scrolling within a DIV
* Added containerId to attributes for smooth scrolling within a DIV
*/
module.directive('scrollTo', ['smoothScroll', function(smoothScroll) {
return {
Expand All @@ -228,13 +228,13 @@
},
link: function($scope, $elem, $attrs) {
var targetElement;

$elem.on('click', function(e) {
e.preventDefault();

targetElement = document.getElementById($attrs.scrollTo);
if ( !targetElement ) return;
if ( !targetElement ) return;

var callbackBefore = function(element) {
if ( $attrs.callbackBefore ) {
var exprHandler = $scope.callbackBefore({element: element});
Expand Down

0 comments on commit 93834ad

Please sign in to comment.