-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add demo app for cancellation of handle movement on page scroll
- Loading branch information
1 parent
8484dc6
commit d38af6e
Showing
8 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...revent-change-on-scroll-slider/prevent-change-on-scroll-slider.component.id-template.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
prevent-change-on-scroll-slider |
2 changes: 2 additions & 0 deletions
2
...s/prevent-change-on-scroll-slider/prevent-change-on-scroll-slider.component.template.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<p>Value: <input type="number" [(ngModel)]="value"></p> | ||
<ngx-slider [(value)]="value" [options]="options" [cancelHandleMovement]="emitOnScroll"></ngx-slider> |
1 change: 1 addition & 0 deletions
1
...ent-change-on-scroll-slider/prevent-change-on-scroll-slider.component.title-template.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Prevent change on page scroll slider |
20 changes: 20 additions & 0 deletions
20
...app/snippets/prevent-change-on-scroll-slider/prevent-change-on-scroll-slider.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Component, HostListener, EventEmitter } from '@angular/core'; | ||
import { Options } from '@local/ngx-slider'; | ||
|
||
@Component({ | ||
selector: 'app-prevent-change-on-scroll-slider', | ||
templateUrl: './prevent-change-on-scroll-slider.component.html' | ||
}) | ||
export class PreventChangeOnScrollSliderComponent { | ||
value: number = 100; | ||
options: Options = { | ||
floor: 0, | ||
ceil: 250 | ||
}; | ||
emitOnScroll: EventEmitter<void> = new EventEmitter<void>; | ||
|
||
@HostListener('window:scroll', ['$event']) | ||
public onScroll(event: any): void { | ||
this.emitOnScroll.emit(); | ||
} | ||
} |