Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@

# Created by https://www.gitignore.io/api/osx,webstorm,node,bower

### OSX ###
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk


### WebStorm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

.idea

# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml

# Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml

# Gradle:
.idea/gradle.xml
.idea/libraries

# Mongo Explorer plugin:
.idea/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties


### Node ###
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history


### Bower ###
bower_components
.bower-cache
.bower-registry
.bower-tmp
15 changes: 8 additions & 7 deletions lib/angular-smooth-scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@
startLocation = getScrollLocation(),
endLocation = getEndLocation(element),
timeLapsed = 0,
distance = endLocation - startLocation,
distance = Math.abs(endLocation - startLocation),
percentage,
position,
positionSign = Math.sign(endLocation - startLocation),
scrollHeight,
internalHeight;

Expand All @@ -110,12 +111,12 @@
*/
var stopAnimation = function () {
currentLocation = getScrollLocation();
if(containerPresent) {
if (containerPresent) {
scrollHeight = container.scrollHeight;
internalHeight = container.clientHeight + currentLocation;
internalHeight = container.clientHeight + currentLocation * positionSign;
} else {
scrollHeight = document.body.scrollheight;
internalHeight = window.innerHeight + currentLocation;
internalHeight = window.innerHeight + currentLocation * positionSign;
}

if (
Expand All @@ -140,9 +141,9 @@
var animateScroll = function () {
timeLapsed += 16;
percentage = ( timeLapsed / duration );
percentage = ( percentage > 1 ) ? 1 : percentage;
position = startLocation + ( distance * getEasingPattern(easing, percentage) );
if(containerPresent) {
percentage = Math.min(percentage, 1);
position = startLocation + (distance * getEasingPattern(easing, percentage)) * positionSign;
if (containerPresent) {
container.scrollTop = position;
} else {
window.scrollTo( 0, position );
Expand Down