Skip to content

Commit ed9f311

Browse files
committed
docs(scrolling): adjust scrolling demo docs
1 parent f40a4c8 commit ed9f311

File tree

5 files changed

+26
-5
lines changed

5 files changed

+26
-5
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
![Grid demo](https://raw.githubusercontent.com/kreuzerk/ng-sortgrid/master/projects/ng-sortgrid-demo/src/assets/grid-demo.gif)
1010

11-
Read the README or just simply check out our demo at: https://kreuzerk.github.io/ng-sortgrid/
11+
[Demo](https://kreuzerk.github.io/ng-sortgrid/)
1212

1313
- [Getting started](#getting-started)
1414
- [Download the module](#download-the-module)
@@ -80,3 +80,21 @@ Alternative you can provide custom styles for the different classes listed bello
8080
| ng-sg-placeholder | This class is added to the placeholder item which previews where the item is inserted |
8181
| ng-sg-dropped | This class is added as soon after you drop an item. The class will be on the item for 500 milliseconds before it gets removed |
8282
| ng-sg-selected | This class is added when you press the CMD or the Ctrl Key and Click on an item. It indicates which items are selected for the multi drag&drop |
83+
84+
# Scrolling
85+
The ng-sortgrid has a *autoScroll* flag which you can use to enable autoScroll. If you enable autoScroll the screen will start to scroll
86+
in the following scenario.
87+
88+
![Grid demo](https://raw.githubusercontent.com/kreuzerk/ng-sortgrid/master/projects/ng-sortgrid-demo/src/assets/scrolling.png)
89+
90+
- If you drag an element in the top 50px of the screen
91+
- If you drag an element in the bottom 50px of the screen
92+
93+
## Custom scroll points
94+
Sometimes its not enough to onyl scroll once you drag over the top view port border. Imagine that you have a fixed navbar
95+
at the top of your page. In this case you need to scroll once you drag an element over the navbar.
96+
97+
## Scroll speed (*default 50*)
98+
The *scrollSpeed* property accepts a number and allows you to specify the scrolling speed.
99+
100+
[Check out the scroll demo](https://kreuzerk.github.io/ng-sortgrid/scrolling)

projects/ng-sortgrid-demo/src/app/scrolling/scrolling.component.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<ngsg-demo-nav [fixed]="true" [height]="height + 'px'" subtitle="Scrolling demo"></ngsg-demo-nav>
2-
<div class="container">
3-
<div class="example-container" style="margin-top: 400px">
2+
<div class="container" style="margin-top: 400px">
3+
<h1>Scrolling</h1>
4+
<ngsg-demo-step title="Sample code to enable scrolling with a custom top scroll point." image="scrolling-code.png"></ngsg-demo-step>
5+
<ngsg-demo-step title="Scroll down to the bottom of the page, drag an item over the blue header (which is the top scroll point) and watch it scroll 😊"></ngsg-demo-step>
6+
<div class="example-container">
47
<ngsg-card *ngFor="let item of items"
58
ngSortgridItem
69
ngSortGridGroup="getting-started"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<h5 class="step-title">{{title}}</h5>
2-
<img [src]="'assets/' + image" class="step-image"/>
2+
<img *ngIf="image" [src]="'assets/' + image" class="step-image"/>
33
<hr/>
76.9 KB
Loading

projects/ng-sortgrid/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
![Grid demo](https://raw.githubusercontent.com/kreuzerk/ng-sortgrid/master/projects/ng-sortgrid-demo/src/assets/grid-demo.gif)
1010

11-
Read the README or just simply check out our demo at: https://kreuzerk.github.io/ng-sortgrid/
11+
[Demo](https://kreuzerk.github.io/ng-sortgrid/)
1212

1313
- [Getting started](#getting-started)
1414
- [Download the module](#download-the-module)

0 commit comments

Comments
 (0)