ngx-page-scroll
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -17,3 +17,5 @@ (function (global, factory) { | ||
// Getter and setter to avoid auto completion to suggest calling the method | ||
get: function () { | ||
get: | ||
// Getter and setter to avoid auto completion to suggest calling the method | ||
function () { | ||
return PageScrollConfig._easingLogic; | ||
@@ -28,73 +30,73 @@ }, | ||
/** | ||
* The number of milliseconds to wait till updating the scroll position again. | ||
* Small amounts may produce smoother animations but require more processing power. | ||
* @type {number} | ||
*/ | ||
* The number of milliseconds to wait till updating the scroll position again. | ||
* Small amounts may produce smoother animations but require more processing power. | ||
* @type {number} | ||
*/ | ||
PageScrollConfig._interval = 10; | ||
/** | ||
* The amount of pixels that need to be between the current scrollTop/scrollLeft position | ||
* and the target position the cause a scroll animation. In case distance is below | ||
* this threshold, an immediate jump will be performed. | ||
* Due to dpi or rounding irregularities in browsers floating point numbers for scrollTop/scrollLeft values | ||
* are possible, making a === comparison of current scrollTop or scrollLeft and target scrollPosition error-prone. | ||
* @type {number} | ||
*/ | ||
* The amount of pixels that need to be between the current scrollTop/scrollLeft position | ||
* and the target position the cause a scroll animation. In case distance is below | ||
* this threshold, an immediate jump will be performed. | ||
* Due to dpi or rounding irregularities in browsers floating point numbers for scrollTop/scrollLeft values | ||
* are possible, making a === comparison of current scrollTop or scrollLeft and target scrollPosition error-prone. | ||
* @type {number} | ||
*/ | ||
PageScrollConfig._minScrollDistance = 2; | ||
/** | ||
* Name of the default namespace. | ||
* @type {string} | ||
*/ | ||
* Name of the default namespace. | ||
* @type {string} | ||
*/ | ||
PageScrollConfig._defaultNamespace = 'default'; | ||
/** | ||
* Whether by default the scrolling should happen in vertical direction (by manipulating the scrollTop property) | ||
* (= true; default) or in horizontal direction (by manipulating the scrollLeft property) (= false | ||
* @type {boolean} | ||
*/ | ||
* Whether by default the scrolling should happen in vertical direction (by manipulating the scrollTop property) | ||
* (= true; default) or in horizontal direction (by manipulating the scrollLeft property) (= false | ||
* @type {boolean} | ||
*/ | ||
PageScrollConfig.defaultIsVerticalScrolling = true; | ||
/** | ||
* How many console logs should be emitted. Also influenced by angular mode (dev or prod mode) | ||
* 0: No logs, neither in dev nor in prod mode | ||
* 1: Animation errors in dev mode, no logs in prod mode | ||
* 2: Animation errors in dev and prod mode | ||
* 5: Animation errors in dev and all scroll position values that get set; animation errors in prod mode | ||
* @type {number} | ||
*/ | ||
* How many console logs should be emitted. Also influenced by angular mode (dev or prod mode) | ||
* 0: No logs, neither in dev nor in prod mode | ||
* 1: Animation errors in dev mode, no logs in prod mode | ||
* 2: Animation errors in dev and prod mode | ||
* 5: Animation errors in dev and all scroll position values that get set; animation errors in prod mode | ||
* @type {number} | ||
*/ | ||
PageScrollConfig._logLevel = 1; | ||
/** | ||
* The duration how long a scrollTo animation should last by default. | ||
* May be overridden using the page-scroll-duration attribute on a single ngxPageScroll instance. | ||
* @type {number} | ||
*/ | ||
* The duration how long a scrollTo animation should last by default. | ||
* May be overridden using the page-scroll-duration attribute on a single ngxPageScroll instance. | ||
* @type {number} | ||
*/ | ||
PageScrollConfig.defaultDuration = 1250; | ||
/** | ||
* The distance in pixels above scroll target where the animation should stop. Setting a positive number results in | ||
* the scroll target being more in the middle of the screen, negative numbers will produce scrolling "too far" | ||
* @type {number} | ||
*/ | ||
* The distance in pixels above scroll target where the animation should stop. Setting a positive number results in | ||
* the scroll target being more in the middle of the screen, negative numbers will produce scrolling "too far" | ||
* @type {number} | ||
*/ | ||
PageScrollConfig.defaultScrollOffset = 0; | ||
/** | ||
* Whether by default for inline scroll animations the advanced offset calculation should take place (true) or | ||
* not (false). Default is false. | ||
* The advanced offset calculation will traverse the DOM tree upwards, starting at the scrollTarget, until it finds | ||
* the scrollingView container element. Along the way the offset positions of the relative positioned | ||
* (position: relative) elements will be taken into account for calculating the target elements position. | ||
* @type {boolean} | ||
*/ | ||
* Whether by default for inline scroll animations the advanced offset calculation should take place (true) or | ||
* not (false). Default is false. | ||
* The advanced offset calculation will traverse the DOM tree upwards, starting at the scrollTarget, until it finds | ||
* the scrollingView container element. Along the way the offset positions of the relative positioned | ||
* (position: relative) elements will be taken into account for calculating the target elements position. | ||
* @type {boolean} | ||
*/ | ||
PageScrollConfig.defaultAdvancedInlineOffsetCalculation = false; | ||
/** | ||
* The events that are listened to on the body to decide whether a scroll animation has been interfered/interrupted by the user | ||
* @type {string[]} | ||
*/ | ||
* The events that are listened to on the body to decide whether a scroll animation has been interfered/interrupted by the user | ||
* @type {string[]} | ||
*/ | ||
PageScrollConfig._interruptEvents = ['mousedown', 'wheel', 'DOMMouseScroll', 'mousewheel', 'keyup', 'touchmove']; | ||
/** | ||
* The keys that are considered to interrupt a scroll animation (mainly the arrow keys). All other key presses will not stop the | ||
* scroll animation. | ||
* @type {number[]} | ||
*/ | ||
* The keys that are considered to interrupt a scroll animation (mainly the arrow keys). All other key presses will not stop the | ||
* scroll animation. | ||
* @type {number[]} | ||
*/ | ||
PageScrollConfig._interruptKeys = [33, 34, 35, 36, 38, 40]; | ||
/** | ||
* Whether a scroll animation should be interruptible by user interaction (true) or not (false). If the user performs an | ||
* interrupting event while a scroll animation takes place, the scroll animation stops. | ||
* @type {boolean} | ||
*/ | ||
* Whether a scroll animation should be interruptible by user interaction (true) or not (false). If the user performs an | ||
* interrupting event while a scroll animation takes place, the scroll animation stops. | ||
* @type {boolean} | ||
*/ | ||
PageScrollConfig.defaultInterruptible = true; | ||
@@ -118,3 +120,13 @@ PageScrollConfig._easingLogic = { | ||
*/ | ||
PageScrollUtilService.isUndefinedOrNull = function (variable) { | ||
/** | ||
* Util method to check whether a given variable is either undefined or null | ||
* @param variable | ||
* @returns {boolean} true the variable is undefined or null | ||
*/ | ||
PageScrollUtilService.isUndefinedOrNull = /** | ||
* Util method to check whether a given variable is either undefined or null | ||
* @param variable | ||
* @returns {boolean} true the variable is undefined or null | ||
*/ | ||
function (variable) { | ||
return (typeof variable === 'undefined') || variable === undefined || variable === null; | ||
@@ -206,3 +218,17 @@ }; | ||
*/ | ||
PageScrollService.prototype.start = function (pageScrollInstance) { | ||
/** | ||
* Start a scroll animation. All properties of the animation are stored in the given {@link PageScrollInstance} object. | ||
* | ||
* This is the core functionality of the whole library. | ||
* | ||
* @param pageScrollInstance | ||
*/ | ||
PageScrollService.prototype.start = /** | ||
* Start a scroll animation. All properties of the animation are stored in the given {@link PageScrollInstance} object. | ||
* | ||
* This is the core functionality of the whole library. | ||
* | ||
* @param pageScrollInstance | ||
*/ | ||
function (pageScrollInstance) { | ||
var _this = this; | ||
@@ -323,3 +349,15 @@ // Stop all possibly running scroll animations in the same namespace | ||
*/ | ||
PageScrollService.prototype.stopAll = function (namespace) { | ||
/** | ||
* Stop all running scroll animations. Optionally limit to stop only the ones of specific namespace. | ||
* | ||
* @param namespace | ||
* @returns {boolean} | ||
*/ | ||
PageScrollService.prototype.stopAll = /** | ||
* Stop all running scroll animations. Optionally limit to stop only the ones of specific namespace. | ||
* | ||
* @param namespace | ||
* @returns {boolean} | ||
*/ | ||
function (namespace) { | ||
if (this.runningInstances.length > 0) { | ||
@@ -376,4 +414,4 @@ var stoppedSome = false; | ||
/** | ||
* These properties will be set during instance construction and default to their defaults from PageScrollConfig | ||
*/ | ||
* These properties will be set during instance construction and default to their defaults from PageScrollConfig | ||
*/ | ||
/* A namespace to "group" scroll animations together and stopping some does not stop others */ | ||
@@ -396,4 +434,4 @@ this._namespace = PageScrollConfig._defaultNamespace; | ||
/** | ||
* These properties will be set/manipulated if the scroll animation starts | ||
*/ | ||
* These properties will be set/manipulated if the scroll animation starts | ||
*/ | ||
/* The initial value of the scrollTop or scrollLeft position when the animation starts */ | ||
@@ -404,3 +442,3 @@ this._startScrollPosition = 0; | ||
/* References to the timer instance that is used to perform the scroll animation to be | ||
able to clear it on animation end*/ | ||
able to clear it on animation end*/ | ||
this._timer = null; | ||
@@ -413,3 +451,9 @@ this._namespace = namespace; | ||
*/ | ||
PageScrollInstance.simpleInstance = function (document, scrollTarget, namespace) { | ||
/* | ||
* Factory methods for instance creation | ||
*/ | ||
PageScrollInstance.simpleInstance = /* | ||
* Factory methods for instance creation | ||
*/ | ||
function (document, scrollTarget, namespace) { | ||
return PageScrollInstance.newInstance({ | ||
@@ -476,3 +520,19 @@ document: document, | ||
*/ | ||
PageScrollInstance.prototype.extractScrollTargetPosition = function () { | ||
/** | ||
* Extract the exact location of the scrollTarget element. | ||
* | ||
* Extract the scrollTarget HTMLElement from the given PageScrollTarget object. The latter one may be | ||
* a string like "#heading2", then this method returns the corresponding DOM element for that id. | ||
* | ||
* @returns {HTMLElement} | ||
*/ | ||
PageScrollInstance.prototype.extractScrollTargetPosition = /** | ||
* Extract the exact location of the scrollTarget element. | ||
* | ||
* Extract the scrollTarget HTMLElement from the given PageScrollTarget object. The latter one may be | ||
* a string like "#heading2", then this method returns the corresponding DOM element for that id. | ||
* | ||
* @returns {HTMLElement} | ||
*/ | ||
function () { | ||
var scrollTargetElement; | ||
@@ -512,2 +572,3 @@ if (typeof this._scrollTarget === 'string') { | ||
// Next iteration | ||
// Next iteration | ||
parent_1 = parent_1.parentElement; | ||
@@ -538,3 +599,17 @@ parentFound = parent_1 === this.scrollingViews[0]; | ||
*/ | ||
PageScrollInstance.prototype.getCurrentOffset = function () { | ||
/** | ||
* Get the top offset of the scroll animation. | ||
* This automatically takes the offset location of the scrolling container/scrolling view | ||
* into account (for nested/inline scrolling). | ||
* | ||
* @returns {number} | ||
*/ | ||
PageScrollInstance.prototype.getCurrentOffset = /** | ||
* Get the top offset of the scroll animation. | ||
* This automatically takes the offset location of the scrolling container/scrolling view | ||
* into account (for nested/inline scrolling). | ||
* | ||
* @returns {number} | ||
*/ | ||
function () { | ||
return this._offset; | ||
@@ -549,3 +624,17 @@ }; | ||
*/ | ||
PageScrollInstance.prototype.setScrollPosition = function (position) { | ||
/** | ||
* Sets the "scrollTop" or "scrollLeft" property for all scrollingViews to the provided value | ||
* @param position | ||
* @return true if at least for one ScrollTopSource the scrollTop/scrollLeft value could be set and it kept the new value. | ||
* false if it failed for all ScrollingViews, meaning that we should stop the animation | ||
* (probably because we're at the end of the scrolling region) | ||
*/ | ||
PageScrollInstance.prototype.setScrollPosition = /** | ||
* Sets the "scrollTop" or "scrollLeft" property for all scrollingViews to the provided value | ||
* @param position | ||
* @return true if at least for one ScrollTopSource the scrollTop/scrollLeft value could be set and it kept the new value. | ||
* false if it failed for all ScrollingViews, meaning that we should stop the animation | ||
* (probably because we're at the end of the scrolling region) | ||
*/ | ||
function (position) { | ||
var _this = this; | ||
@@ -587,3 +676,11 @@ if (PageScrollConfig._logLevel >= 5 && core.isDevMode()) { | ||
*/ | ||
PageScrollInstance.prototype.fireEvent = function (value) { | ||
/** | ||
* Trigger firing a animation finish event | ||
* @param value Whether the animation finished at the target (true) or got interrupted (false) | ||
*/ | ||
PageScrollInstance.prototype.fireEvent = /** | ||
* Trigger firing a animation finish event | ||
* @param value Whether the animation finished at the target (true) or got interrupted (false) | ||
*/ | ||
function (value) { | ||
if (this._pageScrollFinish) { | ||
@@ -601,3 +698,19 @@ this._pageScrollFinish.emit(value); | ||
*/ | ||
PageScrollInstance.prototype.attachInterruptListeners = function (interruptReporter) { | ||
/** | ||
* Attach the interrupt listeners to the PageScrollInstance body. The given interruptReporter | ||
* will be called if any of the attached events is fired. | ||
* | ||
* Possibly attached interruptListeners are automatically removed from the body before the new one will be attached. | ||
* | ||
* @param interruptReporter | ||
*/ | ||
PageScrollInstance.prototype.attachInterruptListeners = /** | ||
* Attach the interrupt listeners to the PageScrollInstance body. The given interruptReporter | ||
* will be called if any of the attached events is fired. | ||
* | ||
* Possibly attached interruptListeners are automatically removed from the body before the new one will be attached. | ||
* | ||
* @param interruptReporter | ||
*/ | ||
function (interruptReporter) { | ||
var _this = this; | ||
@@ -618,3 +731,11 @@ if (this._interruptListenersAttached) { | ||
*/ | ||
PageScrollInstance.prototype.detachInterruptListeners = function () { | ||
/** | ||
* Remove event listeners from the body and stop listening for events that might be treated as "animation | ||
* interrupt" events. | ||
*/ | ||
PageScrollInstance.prototype.detachInterruptListeners = /** | ||
* Remove event listeners from the body and stop listening for events that might be treated as "animation | ||
* interrupt" events. | ||
*/ | ||
function () { | ||
var _this = this; | ||
@@ -820,2 +941,3 @@ PageScrollConfig._interruptEvents.forEach(function (event) { return _this.document.body.removeEventListener(event, _this._interruptListener); }); | ||
var _this = this; | ||
// tslint:disable-line:no-unused-variable | ||
if (this.routerLink && this.router !== null && this.router !== undefined) { | ||
@@ -855,2 +977,3 @@ var urlTree = void 0; | ||
host: { | ||
// tslint:disable-line:use-host-property-decorator | ||
'(click)': 'handleClick($event)', | ||
@@ -867,14 +990,14 @@ } | ||
PageScroll.propDecorators = { | ||
'routerLink': [{ type: core.Input },], | ||
'href': [{ type: core.Input },], | ||
'pageScrollTarget': [{ type: core.Input },], | ||
'pageScrollHorizontal': [{ type: core.Input },], | ||
'pageScrollOffset': [{ type: core.Input },], | ||
'pageScrollDuration': [{ type: core.Input },], | ||
'pageScrollSpeed': [{ type: core.Input },], | ||
'pageScrollEasing': [{ type: core.Input },], | ||
'pageScrollInterruptible': [{ type: core.Input },], | ||
'pageScrollAdjustHash': [{ type: core.Input },], | ||
'pageScroll': [{ type: core.Input },], | ||
'pageScrollFinish': [{ type: core.Output },], | ||
"routerLink": [{ type: core.Input },], | ||
"href": [{ type: core.Input },], | ||
"pageScrollTarget": [{ type: core.Input },], | ||
"pageScrollHorizontal": [{ type: core.Input },], | ||
"pageScrollOffset": [{ type: core.Input },], | ||
"pageScrollDuration": [{ type: core.Input },], | ||
"pageScrollSpeed": [{ type: core.Input },], | ||
"pageScrollEasing": [{ type: core.Input },], | ||
"pageScrollInterruptible": [{ type: core.Input },], | ||
"pageScrollAdjustHash": [{ type: core.Input },], | ||
"pageScroll": [{ type: core.Input },], | ||
"pageScrollFinish": [{ type: core.Output },], | ||
}; | ||
@@ -881,0 +1004,0 @@ return PageScroll; |
@@ -0,1 +1,7 @@ | ||
## 4.0.1 (2017-11-07) | ||
### Other | ||
- Enhance supported angular version to include angular 5 (#254) | ||
## 4.0.0 (2017-10-30) | ||
@@ -2,0 +8,0 @@ |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{},"exports":[{"from":"./src/ngx-page-scroll.directive"},{"from":"./src/ngx-page-scroll.service"},{"from":"./src/ngx-page-scroll-config"},{"from":"./src/ngx-page-scroll-instance"},{"from":"./src/ngx-page-scroll-util.service"},{"from":"./src/ngx-page-scroll.module"}]},{"__symbolic":"module","version":1,"metadata":{},"exports":[{"from":"./src/ngx-page-scroll.directive"},{"from":"./src/ngx-page-scroll.service"},{"from":"./src/ngx-page-scroll-config"},{"from":"./src/ngx-page-scroll-instance"},{"from":"./src/ngx-page-scroll-util.service"},{"from":"./src/ngx-page-scroll.module"}]}] | ||
[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./src/ngx-page-scroll.directive"},{"from":"./src/ngx-page-scroll.service"},{"from":"./src/ngx-page-scroll-config"},{"from":"./src/ngx-page-scroll-instance"},{"from":"./src/ngx-page-scroll-util.service"},{"from":"./src/ngx-page-scroll.module"}]}] |
{ | ||
"name": "ngx-page-scroll", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "Animated scrolling functionality for angular written in pure typescript", | ||
@@ -48,18 +48,19 @@ "scripts": { | ||
"peerDependencies": { | ||
"@angular/core": ">=4.2.6 <5.0.0", | ||
"@angular/common": ">=4.2.6 <5.0.0", | ||
"@angular/platform-browser": ">=4.2.6 <5.0.0", | ||
"@angular/router": ">=4.2.6 <5.0.0" | ||
"@angular/core": ">=4.2.6 <6.0.0", | ||
"@angular/common": ">=4.2.6 <6.0.0", | ||
"@angular/platform-browser": ">=4.2.6 <6.0.0", | ||
"@angular/router": ">=4.2.6 <6.0.0" | ||
}, | ||
"devDependencies": { | ||
"@angular/animations": "^4.3.0", | ||
"@angular/common": "^4.3.0", | ||
"@angular/compiler": "^4.3.0", | ||
"@angular/compiler-cli": "^4.3.0", | ||
"@angular/core": "^4.3.0", | ||
"@angular/platform-browser": "^4.3.0", | ||
"@angular/platform-server": "^4.3.0", | ||
"@angular/router": "^4.3.0", | ||
"@angular/animations": "^5.0.0", | ||
"@angular/common": "^5.0.0", | ||
"@angular/compiler": "^5.0.0", | ||
"@angular/compiler-cli": "^5.0.0", | ||
"@angular/core": "^5.0.0", | ||
"@angular/platform-browser": "^5.0.0", | ||
"@angular/platform-browser-dynamic": "^5.0.0", | ||
"@angular/platform-server": "^5.0.0", | ||
"@angular/router": "^5.0.0", | ||
"@types/jasmine": "^2.5.53", | ||
"codelyzer": "~3.2.2", | ||
"codelyzer": "~4.0.1", | ||
"jasmine-core": "~2.8.0", | ||
@@ -73,5 +74,5 @@ "jasmine-spec-reporter": "~4.2.1", | ||
"tslint": "^5.5.0", | ||
"typescript": "~2.4.1", | ||
"typescript": "~2.4.2", | ||
"zone.js": "^0.8.14" | ||
} | ||
} |
@@ -11,3 +11,3 @@ # ngx-page-scroll [![npm version](https://img.shields.io/npm/v/ngx-page-scroll.svg?style=flat)](https://www.npmjs.com/package/ngx-page-scroll) [![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT) | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/Nolanus/ngx-page-scroll.svg)](https://greenkeeper.io/) | ||
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/bddd94eb51474880ac749b540470c78c)](https://www.codacy.com/app/sebastian-fuss/ngx-page-scroll?utm_source=github.com&utm_medium=referral&utm_content=Nolanus/ngx-page-scroll&utm_campaign=badger) | ||
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/2b93ea8939824803b0807b72a8c2f5a0)](https://www.codacy.com/app/sebastian-fuss/ngx-page-scroll?utm_source=github.com&utm_medium=referral&utm_content=Nolanus/ngx-page-scroll&utm_campaign=Badge_Grade) | ||
@@ -14,0 +14,0 @@ [![Sauce Test Status](https://saucelabs.com/browser-matrix/Nolanus.svg)](https://saucelabs.com/u/Nolanus) |
@@ -12,3 +12,5 @@ var EasingLogic = (function () { | ||
// Getter and setter to avoid auto completion to suggest calling the method | ||
get: function () { | ||
get: | ||
// Getter and setter to avoid auto completion to suggest calling the method | ||
function () { | ||
return PageScrollConfig._easingLogic; | ||
@@ -23,73 +25,73 @@ }, | ||
/** | ||
* The number of milliseconds to wait till updating the scroll position again. | ||
* Small amounts may produce smoother animations but require more processing power. | ||
* @type {number} | ||
*/ | ||
* The number of milliseconds to wait till updating the scroll position again. | ||
* Small amounts may produce smoother animations but require more processing power. | ||
* @type {number} | ||
*/ | ||
PageScrollConfig._interval = 10; | ||
/** | ||
* The amount of pixels that need to be between the current scrollTop/scrollLeft position | ||
* and the target position the cause a scroll animation. In case distance is below | ||
* this threshold, an immediate jump will be performed. | ||
* Due to dpi or rounding irregularities in browsers floating point numbers for scrollTop/scrollLeft values | ||
* are possible, making a === comparison of current scrollTop or scrollLeft and target scrollPosition error-prone. | ||
* @type {number} | ||
*/ | ||
* The amount of pixels that need to be between the current scrollTop/scrollLeft position | ||
* and the target position the cause a scroll animation. In case distance is below | ||
* this threshold, an immediate jump will be performed. | ||
* Due to dpi or rounding irregularities in browsers floating point numbers for scrollTop/scrollLeft values | ||
* are possible, making a === comparison of current scrollTop or scrollLeft and target scrollPosition error-prone. | ||
* @type {number} | ||
*/ | ||
PageScrollConfig._minScrollDistance = 2; | ||
/** | ||
* Name of the default namespace. | ||
* @type {string} | ||
*/ | ||
* Name of the default namespace. | ||
* @type {string} | ||
*/ | ||
PageScrollConfig._defaultNamespace = 'default'; | ||
/** | ||
* Whether by default the scrolling should happen in vertical direction (by manipulating the scrollTop property) | ||
* (= true; default) or in horizontal direction (by manipulating the scrollLeft property) (= false | ||
* @type {boolean} | ||
*/ | ||
* Whether by default the scrolling should happen in vertical direction (by manipulating the scrollTop property) | ||
* (= true; default) or in horizontal direction (by manipulating the scrollLeft property) (= false | ||
* @type {boolean} | ||
*/ | ||
PageScrollConfig.defaultIsVerticalScrolling = true; | ||
/** | ||
* How many console logs should be emitted. Also influenced by angular mode (dev or prod mode) | ||
* 0: No logs, neither in dev nor in prod mode | ||
* 1: Animation errors in dev mode, no logs in prod mode | ||
* 2: Animation errors in dev and prod mode | ||
* 5: Animation errors in dev and all scroll position values that get set; animation errors in prod mode | ||
* @type {number} | ||
*/ | ||
* How many console logs should be emitted. Also influenced by angular mode (dev or prod mode) | ||
* 0: No logs, neither in dev nor in prod mode | ||
* 1: Animation errors in dev mode, no logs in prod mode | ||
* 2: Animation errors in dev and prod mode | ||
* 5: Animation errors in dev and all scroll position values that get set; animation errors in prod mode | ||
* @type {number} | ||
*/ | ||
PageScrollConfig._logLevel = 1; | ||
/** | ||
* The duration how long a scrollTo animation should last by default. | ||
* May be overridden using the page-scroll-duration attribute on a single ngxPageScroll instance. | ||
* @type {number} | ||
*/ | ||
* The duration how long a scrollTo animation should last by default. | ||
* May be overridden using the page-scroll-duration attribute on a single ngxPageScroll instance. | ||
* @type {number} | ||
*/ | ||
PageScrollConfig.defaultDuration = 1250; | ||
/** | ||
* The distance in pixels above scroll target where the animation should stop. Setting a positive number results in | ||
* the scroll target being more in the middle of the screen, negative numbers will produce scrolling "too far" | ||
* @type {number} | ||
*/ | ||
* The distance in pixels above scroll target where the animation should stop. Setting a positive number results in | ||
* the scroll target being more in the middle of the screen, negative numbers will produce scrolling "too far" | ||
* @type {number} | ||
*/ | ||
PageScrollConfig.defaultScrollOffset = 0; | ||
/** | ||
* Whether by default for inline scroll animations the advanced offset calculation should take place (true) or | ||
* not (false). Default is false. | ||
* The advanced offset calculation will traverse the DOM tree upwards, starting at the scrollTarget, until it finds | ||
* the scrollingView container element. Along the way the offset positions of the relative positioned | ||
* (position: relative) elements will be taken into account for calculating the target elements position. | ||
* @type {boolean} | ||
*/ | ||
* Whether by default for inline scroll animations the advanced offset calculation should take place (true) or | ||
* not (false). Default is false. | ||
* The advanced offset calculation will traverse the DOM tree upwards, starting at the scrollTarget, until it finds | ||
* the scrollingView container element. Along the way the offset positions of the relative positioned | ||
* (position: relative) elements will be taken into account for calculating the target elements position. | ||
* @type {boolean} | ||
*/ | ||
PageScrollConfig.defaultAdvancedInlineOffsetCalculation = false; | ||
/** | ||
* The events that are listened to on the body to decide whether a scroll animation has been interfered/interrupted by the user | ||
* @type {string[]} | ||
*/ | ||
* The events that are listened to on the body to decide whether a scroll animation has been interfered/interrupted by the user | ||
* @type {string[]} | ||
*/ | ||
PageScrollConfig._interruptEvents = ['mousedown', 'wheel', 'DOMMouseScroll', 'mousewheel', 'keyup', 'touchmove']; | ||
/** | ||
* The keys that are considered to interrupt a scroll animation (mainly the arrow keys). All other key presses will not stop the | ||
* scroll animation. | ||
* @type {number[]} | ||
*/ | ||
* The keys that are considered to interrupt a scroll animation (mainly the arrow keys). All other key presses will not stop the | ||
* scroll animation. | ||
* @type {number[]} | ||
*/ | ||
PageScrollConfig._interruptKeys = [33, 34, 35, 36, 38, 40]; | ||
/** | ||
* Whether a scroll animation should be interruptible by user interaction (true) or not (false). If the user performs an | ||
* interrupting event while a scroll animation takes place, the scroll animation stops. | ||
* @type {boolean} | ||
*/ | ||
* Whether a scroll animation should be interruptible by user interaction (true) or not (false). If the user performs an | ||
* interrupting event while a scroll animation takes place, the scroll animation stops. | ||
* @type {boolean} | ||
*/ | ||
PageScrollConfig.defaultInterruptible = true; | ||
@@ -96,0 +98,0 @@ PageScrollConfig._easingLogic = { |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"EasingLogic":{"__symbolic":"class","members":{"ease":[{"__symbolic":"method"}]}},"PageScrollTarget":{"__symbolic":"interface"},"PageScrollingViews":{"__symbolic":"interface"},"PageScrollConfig":{"__symbolic":"class","statics":{"_interval":10,"_minScrollDistance":2,"_defaultNamespace":"default","defaultIsVerticalScrolling":true,"_logLevel":1,"defaultDuration":1250,"defaultScrollOffset":0,"defaultAdvancedInlineOffsetCalculation":false,"_interruptEvents":["mousedown","wheel","DOMMouseScroll","mousewheel","keyup","touchmove"],"_interruptKeys":[33,34,35,36,38,40],"defaultInterruptible":true,"_easingLogic":{"__symbolic":"error","message":"Function call not supported","line":103,"character":14},"defaultEasingLogic":{"__symbolic":"error","message":"Variable not initialized","line":114,"character":22}}}}},{"__symbolic":"module","version":1,"metadata":{"EasingLogic":{"__symbolic":"class","members":{"ease":[{"__symbolic":"method"}]}},"PageScrollTarget":{"__symbolic":"interface"},"PageScrollingViews":{"__symbolic":"interface"},"PageScrollConfig":{"__symbolic":"class","statics":{"_interval":10,"_minScrollDistance":2,"_defaultNamespace":"default","defaultIsVerticalScrolling":true,"_logLevel":1,"defaultDuration":1250,"defaultScrollOffset":0,"defaultAdvancedInlineOffsetCalculation":false,"_interruptEvents":["mousedown","wheel","DOMMouseScroll","mousewheel","keyup","touchmove"],"_interruptKeys":[33,34,35,36,38,40],"defaultInterruptible":true,"_easingLogic":{"__symbolic":"error","message":"Function call not supported","line":103,"character":14},"defaultEasingLogic":{"__symbolic":"error","message":"Variable not initialized","line":114,"character":22}}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"EasingLogic":{"__symbolic":"class","members":{"ease":[{"__symbolic":"method"}]}},"PageScrollTarget":{"__symbolic":"interface"},"PageScrollingViews":{"__symbolic":"interface"},"PageScrollConfig":{"__symbolic":"class","statics":{"_interval":10,"_minScrollDistance":2,"_defaultNamespace":"default","defaultIsVerticalScrolling":true,"_logLevel":1,"defaultDuration":1250,"defaultScrollOffset":0,"defaultAdvancedInlineOffsetCalculation":false,"_interruptEvents":["mousedown","wheel","DOMMouseScroll","mousewheel","keyup","touchmove"],"_interruptKeys":[33,34,35,36,38,40],"defaultInterruptible":true,"_easingLogic":{"__symbolic":"error","message":"Function call not supported","line":103,"character":14},"defaultEasingLogic":{"__symbolic":"error","message":"Variable not initialized","line":114,"character":22}}}}}] |
@@ -7,3 +7,6 @@ import { EventEmitter, isDevMode } from '@angular/core'; | ||
*/ | ||
var PageScrollInstance = (function () { | ||
var /** | ||
* Represents a scrolling action | ||
*/ | ||
PageScrollInstance = (function () { | ||
/** | ||
@@ -19,4 +22,4 @@ * Private constructor, requires the properties assumed to be the bare minimum. | ||
/** | ||
* These properties will be set during instance construction and default to their defaults from PageScrollConfig | ||
*/ | ||
* These properties will be set during instance construction and default to their defaults from PageScrollConfig | ||
*/ | ||
/* A namespace to "group" scroll animations together and stopping some does not stop others */ | ||
@@ -39,4 +42,4 @@ this._namespace = PageScrollConfig._defaultNamespace; | ||
/** | ||
* These properties will be set/manipulated if the scroll animation starts | ||
*/ | ||
* These properties will be set/manipulated if the scroll animation starts | ||
*/ | ||
/* The initial value of the scrollTop or scrollLeft position when the animation starts */ | ||
@@ -47,3 +50,3 @@ this._startScrollPosition = 0; | ||
/* References to the timer instance that is used to perform the scroll animation to be | ||
able to clear it on animation end*/ | ||
able to clear it on animation end*/ | ||
this._timer = null; | ||
@@ -56,3 +59,9 @@ this._namespace = namespace; | ||
*/ | ||
PageScrollInstance.simpleInstance = function (document, scrollTarget, namespace) { | ||
/* | ||
* Factory methods for instance creation | ||
*/ | ||
PageScrollInstance.simpleInstance = /* | ||
* Factory methods for instance creation | ||
*/ | ||
function (document, scrollTarget, namespace) { | ||
return PageScrollInstance.newInstance({ | ||
@@ -119,3 +128,19 @@ document: document, | ||
*/ | ||
PageScrollInstance.prototype.extractScrollTargetPosition = function () { | ||
/** | ||
* Extract the exact location of the scrollTarget element. | ||
* | ||
* Extract the scrollTarget HTMLElement from the given PageScrollTarget object. The latter one may be | ||
* a string like "#heading2", then this method returns the corresponding DOM element for that id. | ||
* | ||
* @returns {HTMLElement} | ||
*/ | ||
PageScrollInstance.prototype.extractScrollTargetPosition = /** | ||
* Extract the exact location of the scrollTarget element. | ||
* | ||
* Extract the scrollTarget HTMLElement from the given PageScrollTarget object. The latter one may be | ||
* a string like "#heading2", then this method returns the corresponding DOM element for that id. | ||
* | ||
* @returns {HTMLElement} | ||
*/ | ||
function () { | ||
var scrollTargetElement; | ||
@@ -155,2 +180,3 @@ if (typeof this._scrollTarget === 'string') { | ||
// Next iteration | ||
// Next iteration | ||
parent_1 = parent_1.parentElement; | ||
@@ -181,3 +207,17 @@ parentFound = parent_1 === this.scrollingViews[0]; | ||
*/ | ||
PageScrollInstance.prototype.getCurrentOffset = function () { | ||
/** | ||
* Get the top offset of the scroll animation. | ||
* This automatically takes the offset location of the scrolling container/scrolling view | ||
* into account (for nested/inline scrolling). | ||
* | ||
* @returns {number} | ||
*/ | ||
PageScrollInstance.prototype.getCurrentOffset = /** | ||
* Get the top offset of the scroll animation. | ||
* This automatically takes the offset location of the scrolling container/scrolling view | ||
* into account (for nested/inline scrolling). | ||
* | ||
* @returns {number} | ||
*/ | ||
function () { | ||
return this._offset; | ||
@@ -192,3 +232,17 @@ }; | ||
*/ | ||
PageScrollInstance.prototype.setScrollPosition = function (position) { | ||
/** | ||
* Sets the "scrollTop" or "scrollLeft" property for all scrollingViews to the provided value | ||
* @param position | ||
* @return true if at least for one ScrollTopSource the scrollTop/scrollLeft value could be set and it kept the new value. | ||
* false if it failed for all ScrollingViews, meaning that we should stop the animation | ||
* (probably because we're at the end of the scrolling region) | ||
*/ | ||
PageScrollInstance.prototype.setScrollPosition = /** | ||
* Sets the "scrollTop" or "scrollLeft" property for all scrollingViews to the provided value | ||
* @param position | ||
* @return true if at least for one ScrollTopSource the scrollTop/scrollLeft value could be set and it kept the new value. | ||
* false if it failed for all ScrollingViews, meaning that we should stop the animation | ||
* (probably because we're at the end of the scrolling region) | ||
*/ | ||
function (position) { | ||
var _this = this; | ||
@@ -230,3 +284,11 @@ if (PageScrollConfig._logLevel >= 5 && isDevMode()) { | ||
*/ | ||
PageScrollInstance.prototype.fireEvent = function (value) { | ||
/** | ||
* Trigger firing a animation finish event | ||
* @param value Whether the animation finished at the target (true) or got interrupted (false) | ||
*/ | ||
PageScrollInstance.prototype.fireEvent = /** | ||
* Trigger firing a animation finish event | ||
* @param value Whether the animation finished at the target (true) or got interrupted (false) | ||
*/ | ||
function (value) { | ||
if (this._pageScrollFinish) { | ||
@@ -244,3 +306,19 @@ this._pageScrollFinish.emit(value); | ||
*/ | ||
PageScrollInstance.prototype.attachInterruptListeners = function (interruptReporter) { | ||
/** | ||
* Attach the interrupt listeners to the PageScrollInstance body. The given interruptReporter | ||
* will be called if any of the attached events is fired. | ||
* | ||
* Possibly attached interruptListeners are automatically removed from the body before the new one will be attached. | ||
* | ||
* @param interruptReporter | ||
*/ | ||
PageScrollInstance.prototype.attachInterruptListeners = /** | ||
* Attach the interrupt listeners to the PageScrollInstance body. The given interruptReporter | ||
* will be called if any of the attached events is fired. | ||
* | ||
* Possibly attached interruptListeners are automatically removed from the body before the new one will be attached. | ||
* | ||
* @param interruptReporter | ||
*/ | ||
function (interruptReporter) { | ||
var _this = this; | ||
@@ -261,3 +339,11 @@ if (this._interruptListenersAttached) { | ||
*/ | ||
PageScrollInstance.prototype.detachInterruptListeners = function () { | ||
/** | ||
* Remove event listeners from the body and stop listening for events that might be treated as "animation | ||
* interrupt" events. | ||
*/ | ||
PageScrollInstance.prototype.detachInterruptListeners = /** | ||
* Remove event listeners from the body and stop listening for events that might be treated as "animation | ||
* interrupt" events. | ||
*/ | ||
function () { | ||
var _this = this; | ||
@@ -402,2 +488,5 @@ PageScrollConfig._interruptEvents.forEach(function (event) { return _this.document.body.removeEventListener(event, _this._interruptListener); }); | ||
}()); | ||
/** | ||
* Represents a scrolling action | ||
*/ | ||
export { PageScrollInstance }; |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"PageScrollOptions":{"__symbolic":"interface"},"PageScrollInstance":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"error","message":"Could not resolve type","line":208,"character":45,"context":{"typeName":"Document"}}]}],"getScrollPropertyValue":[{"__symbolic":"method"}],"extractScrollTargetPosition":[{"__symbolic":"method"}],"getCurrentOffset":[{"__symbolic":"method"}],"setScrollPosition":[{"__symbolic":"method"}],"fireEvent":[{"__symbolic":"method"}],"attachInterruptListeners":[{"__symbolic":"method"}],"detachInterruptListeners":[{"__symbolic":"method"}]},"statics":{"simpleInstance":{"__symbolic":"function","parameters":["document","scrollTarget","namespace"],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"PageScrollInstance"},"member":"newInstance"},"arguments":[{"document":{"__symbolic":"reference","name":"document"},"scrollTarget":{"__symbolic":"reference","name":"scrollTarget"},"namespace":{"__symbolic":"reference","name":"namespace"}}]}}}},"InterruptReporter":{"__symbolic":"interface"}}},{"__symbolic":"module","version":1,"metadata":{"PageScrollOptions":{"__symbolic":"interface"},"PageScrollInstance":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"error","message":"Could not resolve type","line":208,"character":45,"context":{"typeName":"Document"}}]}],"getScrollPropertyValue":[{"__symbolic":"method"}],"extractScrollTargetPosition":[{"__symbolic":"method"}],"getCurrentOffset":[{"__symbolic":"method"}],"setScrollPosition":[{"__symbolic":"method"}],"fireEvent":[{"__symbolic":"method"}],"attachInterruptListeners":[{"__symbolic":"method"}],"detachInterruptListeners":[{"__symbolic":"method"}]},"statics":{"simpleInstance":{"__symbolic":"function","parameters":["document","scrollTarget","namespace"],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"PageScrollInstance"},"member":"newInstance"},"arguments":[{"document":{"__symbolic":"reference","name":"document"},"scrollTarget":{"__symbolic":"reference","name":"scrollTarget"},"namespace":{"__symbolic":"reference","name":"namespace"}}]}}}},"InterruptReporter":{"__symbolic":"interface"}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"PageScrollOptions":{"__symbolic":"interface"},"PageScrollInstance":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"error","message":"Could not resolve type","line":208,"character":45,"context":{"typeName":"Document"}}]}],"getScrollPropertyValue":[{"__symbolic":"method"}],"extractScrollTargetPosition":[{"__symbolic":"method"}],"getCurrentOffset":[{"__symbolic":"method"}],"setScrollPosition":[{"__symbolic":"method"}],"fireEvent":[{"__symbolic":"method"}],"attachInterruptListeners":[{"__symbolic":"method"}],"detachInterruptListeners":[{"__symbolic":"method"}]},"statics":{"simpleInstance":{"__symbolic":"function","parameters":["document","scrollTarget","namespace"],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"PageScrollInstance"},"member":"newInstance"},"arguments":[{"document":{"__symbolic":"reference","name":"document"},"scrollTarget":{"__symbolic":"reference","name":"scrollTarget"},"namespace":{"__symbolic":"reference","name":"namespace"}}]}}}},"InterruptReporter":{"__symbolic":"interface"}}}] |
@@ -9,3 +9,13 @@ var PageScrollUtilService = (function () { | ||
*/ | ||
PageScrollUtilService.isUndefinedOrNull = function (variable) { | ||
/** | ||
* Util method to check whether a given variable is either undefined or null | ||
* @param variable | ||
* @returns {boolean} true the variable is undefined or null | ||
*/ | ||
PageScrollUtilService.isUndefinedOrNull = /** | ||
* Util method to check whether a given variable is either undefined or null | ||
* @param variable | ||
* @returns {boolean} true the variable is undefined or null | ||
*/ | ||
function (variable) { | ||
return (typeof variable === 'undefined') || variable === undefined || variable === null; | ||
@@ -12,0 +22,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"PageScrollUtilService":{"__symbolic":"class","statics":{"isUndefinedOrNull":{"__symbolic":"function","parameters":["variable"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":8,"character":16},"right":"undefined"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"variable"},"right":{"__symbolic":"reference","name":"undefined"}}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"variable"},"right":null}}}}}}},{"__symbolic":"module","version":1,"metadata":{"PageScrollUtilService":{"__symbolic":"class","statics":{"isUndefinedOrNull":{"__symbolic":"function","parameters":["variable"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":8,"character":16},"right":"undefined"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"variable"},"right":{"__symbolic":"reference","name":"undefined"}}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"variable"},"right":null}}}}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"PageScrollUtilService":{"__symbolic":"class","statics":{"isUndefinedOrNull":{"__symbolic":"function","parameters":["variable"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":8,"character":16},"right":"undefined"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"variable"},"right":{"__symbolic":"reference","name":"undefined"}}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"variable"},"right":null}}}}}}}] |
@@ -7,2 +7,3 @@ import { Directive, Input, Output, EventEmitter, Inject, Optional } from '@angular/core'; | ||
import { PageScrollUtilService as Util } from './ngx-page-scroll-util.service'; | ||
import { EasingLogic } from './ngx-page-scroll-config'; | ||
var PageScroll = (function () { | ||
@@ -68,2 +69,3 @@ function PageScroll(pageScrollService, router, document) { | ||
var _this = this; | ||
// tslint:disable-line:no-unused-variable | ||
if (this.routerLink && this.router !== null && this.router !== undefined) { | ||
@@ -103,2 +105,3 @@ var urlTree = void 0; | ||
host: { | ||
// tslint:disable-line:use-host-property-decorator | ||
'(click)': 'handleClick($event)', | ||
@@ -115,14 +118,14 @@ } | ||
PageScroll.propDecorators = { | ||
'routerLink': [{ type: Input },], | ||
'href': [{ type: Input },], | ||
'pageScrollTarget': [{ type: Input },], | ||
'pageScrollHorizontal': [{ type: Input },], | ||
'pageScrollOffset': [{ type: Input },], | ||
'pageScrollDuration': [{ type: Input },], | ||
'pageScrollSpeed': [{ type: Input },], | ||
'pageScrollEasing': [{ type: Input },], | ||
'pageScrollInterruptible': [{ type: Input },], | ||
'pageScrollAdjustHash': [{ type: Input },], | ||
'pageScroll': [{ type: Input },], | ||
'pageScrollFinish': [{ type: Output },], | ||
"routerLink": [{ type: Input },], | ||
"href": [{ type: Input },], | ||
"pageScrollTarget": [{ type: Input },], | ||
"pageScrollHorizontal": [{ type: Input },], | ||
"pageScrollOffset": [{ type: Input },], | ||
"pageScrollDuration": [{ type: Input },], | ||
"pageScrollSpeed": [{ type: Input },], | ||
"pageScrollEasing": [{ type: Input },], | ||
"pageScrollInterruptible": [{ type: Input },], | ||
"pageScrollAdjustHash": [{ type: Input },], | ||
"pageScroll": [{ type: Input },], | ||
"pageScrollFinish": [{ type: Output },], | ||
}; | ||
@@ -129,0 +132,0 @@ return PageScroll; |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"PageScroll":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[pageScroll]","host":{"(click)":"handleClick($event)","$quoted$":["(click)"]}}]}],"members":{"routerLink":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"href":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollTarget":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollHorizontal":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollOffset":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollSpeed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollEasing":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollInterruptible":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollAdjustHash":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScroll":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollFinish":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT"}]}]],"parameters":[{"__symbolic":"reference","module":"./ngx-page-scroll.service","name":"PageScrollService"},{"__symbolic":"reference","module":"@angular/router","name":"Router"},{"__symbolic":"reference","name":"any"}]}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"generatePageScrollInstance":[{"__symbolic":"method"}],"pushRouterState":[{"__symbolic":"method"}],"scroll":[{"__symbolic":"method"}],"handleClick":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"PageScroll":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[pageScroll]","host":{"(click)":"handleClick($event)"}}]}],"members":{"routerLink":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"href":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollTarget":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollHorizontal":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollOffset":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollSpeed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollEasing":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollInterruptible":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollAdjustHash":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScroll":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollFinish":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT"}]}]],"parameters":[{"__symbolic":"reference","module":"./ngx-page-scroll.service","name":"PageScrollService"},{"__symbolic":"reference","module":"@angular/router","name":"Router"},{"__symbolic":"reference","name":"any"}]}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"generatePageScrollInstance":[{"__symbolic":"method"}],"pushRouterState":[{"__symbolic":"method"}],"scroll":[{"__symbolic":"method"}],"handleClick":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"PageScroll":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[pageScroll]","host":{"(click)":"handleClick($event)","$quoted$":["(click)"]}}]}],"members":{"routerLink":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"href":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollTarget":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollHorizontal":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollOffset":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollDuration":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollSpeed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollEasing":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollInterruptible":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollAdjustHash":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScroll":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pageScrollFinish":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT"}]}]],"parameters":[{"__symbolic":"reference","module":"./ngx-page-scroll.service","name":"PageScrollService"},{"__symbolic":"reference","module":"@angular/router","name":"Router"},{"__symbolic":"reference","name":"any"}]}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"generatePageScrollInstance":[{"__symbolic":"method"}],"pushRouterState":[{"__symbolic":"method"}],"scroll":[{"__symbolic":"method"}],"handleClick":[{"__symbolic":"method"}]}}}}] |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"NgxPageScrollModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"}],"declarations":[{"__symbolic":"reference","module":"./ngx-page-scroll.directive","name":"PageScroll"}],"exports":[{"__symbolic":"reference","module":"./ngx-page-scroll.directive","name":"PageScroll"}],"providers":[{"__symbolic":"reference","module":"./ngx-page-scroll.service","name":"NgxPageScrollServiceProvider"}]}]}]}}},{"__symbolic":"module","version":1,"metadata":{"NgxPageScrollModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"}],"declarations":[{"__symbolic":"reference","module":"./ngx-page-scroll.directive","name":"PageScroll"}],"exports":[{"__symbolic":"reference","module":"./ngx-page-scroll.directive","name":"PageScroll"}],"providers":[{"__symbolic":"reference","module":"./ngx-page-scroll.service","name":"NgxPageScrollServiceProvider"}]}]}]}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"NgxPageScrollModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"}],"declarations":[{"__symbolic":"reference","module":"./ngx-page-scroll.directive","name":"PageScroll"}],"exports":[{"__symbolic":"reference","module":"./ngx-page-scroll.directive","name":"PageScroll"}],"providers":[{"__symbolic":"reference","module":"./ngx-page-scroll.service","name":"NgxPageScrollServiceProvider"}]}]}]}}}] |
@@ -67,3 +67,17 @@ import { Injectable, Optional, SkipSelf, isDevMode } from '@angular/core'; | ||
*/ | ||
PageScrollService.prototype.start = function (pageScrollInstance) { | ||
/** | ||
* Start a scroll animation. All properties of the animation are stored in the given {@link PageScrollInstance} object. | ||
* | ||
* This is the core functionality of the whole library. | ||
* | ||
* @param pageScrollInstance | ||
*/ | ||
PageScrollService.prototype.start = /** | ||
* Start a scroll animation. All properties of the animation are stored in the given {@link PageScrollInstance} object. | ||
* | ||
* This is the core functionality of the whole library. | ||
* | ||
* @param pageScrollInstance | ||
*/ | ||
function (pageScrollInstance) { | ||
var _this = this; | ||
@@ -184,3 +198,15 @@ // Stop all possibly running scroll animations in the same namespace | ||
*/ | ||
PageScrollService.prototype.stopAll = function (namespace) { | ||
/** | ||
* Stop all running scroll animations. Optionally limit to stop only the ones of specific namespace. | ||
* | ||
* @param namespace | ||
* @returns {boolean} | ||
*/ | ||
PageScrollService.prototype.stopAll = /** | ||
* Stop all running scroll animations. Optionally limit to stop only the ones of specific namespace. | ||
* | ||
* @param namespace | ||
* @returns {boolean} | ||
*/ | ||
function (namespace) { | ||
if (this.runningInstances.length > 0) { | ||
@@ -187,0 +213,0 @@ var stoppedSome = false; |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"PageScrollService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"stopInternal":[{"__symbolic":"method"}],"start":[{"__symbolic":"method"}],"stopAll":[{"__symbolic":"method"}],"stop":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor"}]},"statics":{"instanceCounter":0}},"NgxPageScrollServiceProviderFactory":{"__symbolic":"function","parameters":["parentDispatcher"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"reference","name":"parentDispatcher"},"right":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"PageScrollService"}}}},"NgxPageScrollServiceProvider":{"provide":{"__symbolic":"reference","name":"PageScrollService"},"deps":[[{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}},{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf"}},{"__symbolic":"reference","name":"PageScrollService"}]],"useFactory":{"__symbolic":"reference","name":"NgxPageScrollServiceProviderFactory"}}}},{"__symbolic":"module","version":1,"metadata":{"PageScrollService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"stopInternal":[{"__symbolic":"method"}],"start":[{"__symbolic":"method"}],"stopAll":[{"__symbolic":"method"}],"stop":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor"}]},"statics":{"instanceCounter":0}},"NgxPageScrollServiceProviderFactory":{"__symbolic":"function","parameters":["parentDispatcher"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"reference","name":"parentDispatcher"},"right":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"PageScrollService"}}}},"NgxPageScrollServiceProvider":{"provide":{"__symbolic":"reference","name":"PageScrollService"},"deps":[[{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}},{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf"}},{"__symbolic":"reference","name":"PageScrollService"}]],"useFactory":{"__symbolic":"reference","name":"NgxPageScrollServiceProviderFactory"}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"PageScrollService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"stopInternal":[{"__symbolic":"method"}],"start":[{"__symbolic":"method"}],"stopAll":[{"__symbolic":"method"}],"stop":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor"}]},"statics":{"instanceCounter":0}},"NgxPageScrollServiceProviderFactory":{"__symbolic":"function","parameters":["parentDispatcher"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"reference","name":"parentDispatcher"},"right":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"PageScrollService"}}}},"NgxPageScrollServiceProvider":{"provide":{"__symbolic":"reference","name":"PageScrollService"},"deps":[[{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}},{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf"}},{"__symbolic":"reference","name":"PageScrollService"}]],"useFactory":{"__symbolic":"reference","name":"NgxPageScrollServiceProviderFactory"}}}}] |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
159237
2485
21