Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
smoothscroll
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
grifart libs
smoothscroll
Commits
5f64a327
Commit
5f64a327
authored
4 years ago
by
Daniel Kurowski
Browse files
Options
Downloads
Patches
Plain Diff
Exposed scrollTo*() methods through API
parent
62889442
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!8
Resolve "Expose manual scrollTo*() methods to public API"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/index.ts
+20
-1
20 additions, 1 deletion
src/index.ts
with
20 additions
and
1 deletion
src/index.ts
+
20
−
1
View file @
5f64a327
...
...
@@ -2,6 +2,10 @@ import * as Velocity from 'velocity-animate';
import
setupVelocity
from
'
./easing/setupVelocity
'
;
import
{
initializeOnLoadScroll
}
from
'
./handlers/loadScroll/initializeOnLoadScroll
'
;
import
{
initializeOnLinkClickScroll
}
from
'
./handlers/linkClickScroll/initializeOnLinkClickScroll
'
;
import
{
scrollToElement
}
from
'
./scrollers/scrollToElement
'
;
import
{
scrollToOffset
}
from
'
./scrollers/scrollToOffset
'
;
import
{
scrollToTarget
}
from
'
./scrollers/scrollToTarget
'
;
import
{
HashTarget
}
from
'
./HashTarget
'
;
export
interface
SmoothScrollOptions
{
readonly
scrollOnLoad
?:
boolean
;
...
...
@@ -9,7 +13,7 @@ export interface SmoothScrollOptions {
}
/**
* Wrapped into class for intuitive API use – `SmoothScroll.
enable
()`
* Wrapped into class for intuitive API use – `SmoothScroll.
something
()`
*/
class
SmoothScroll
{
...
...
@@ -25,6 +29,21 @@ class SmoothScroll
initializeOnLinkClickScroll
();
}
}
public
static
scrollToElement
(
element
:
HTMLElement
,
onScrollFinishedCallback
?:
()
=>
void
):
void
{
scrollToElement
(
element
,
onScrollFinishedCallback
);
}
public
static
scrollToOffset
(
topOffset
:
number
,
onScrollFinishedCallback
?:
()
=>
void
):
void
{
scrollToOffset
(
topOffset
,
onScrollFinishedCallback
);
}
public
static
scrollToTarget
(
target
:
HashTarget
,
onScrollFinishedCallback
?:
()
=>
void
):
void
{
scrollToTarget
(
target
,
onScrollFinishedCallback
);
}
}
export
default
SmoothScroll
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment