@linear_non/stellar-libs 1.0.44 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/ScrollBar/index.js +22 -22
- package/src/SplitOnScroll/index.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linear_non/stellar-libs",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Reusable JavaScript libraries for Non-Linear Studio projects.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"author": "Non-Linear Studio",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@linear_non/stellar-kit": "^2.1.
|
|
28
|
+
"@linear_non/stellar-kit": "^2.1.21"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@linear_non/prettier-config": "^1.0.6",
|
package/src/ScrollBar/index.js
CHANGED
|
@@ -17,28 +17,6 @@ export default class Scrollbar {
|
|
|
17
17
|
this.init()
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
init() {
|
|
21
|
-
this.create()
|
|
22
|
-
this.setBounds()
|
|
23
|
-
this.on()
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
on() {
|
|
27
|
-
emitter.on(EVENTS.APP_TICK, this.tick)
|
|
28
|
-
emitter.on(EVENTS.APP_RESIZE, this.resize)
|
|
29
|
-
this.handle.addEventListener("mousedown", this.mouseDown)
|
|
30
|
-
window.addEventListener("mouseup", this.mouseUp)
|
|
31
|
-
window.addEventListener("mousemove", this.mouseMove)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
off() {
|
|
35
|
-
emitter.off(EVENTS.APP_TICK, this.tick)
|
|
36
|
-
emitter.off(EVENTS.APP_RESIZE, this.resize)
|
|
37
|
-
this.handle.removeEventListener("mousedown", this.mouseDown)
|
|
38
|
-
window.removeEventListener("mouseup", this.mouseUp)
|
|
39
|
-
window.removeEventListener("mousemove", this.mouseMove)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
20
|
mouseDown = () => {
|
|
43
21
|
this.touching = true
|
|
44
22
|
document.body.style.userSelect = "none"
|
|
@@ -121,4 +99,26 @@ export default class Scrollbar {
|
|
|
121
99
|
destroy() {
|
|
122
100
|
this.off()
|
|
123
101
|
}
|
|
102
|
+
|
|
103
|
+
on() {
|
|
104
|
+
emitter.on(EVENTS.APP_TICK, this.tick)
|
|
105
|
+
emitter.on(EVENTS.APP_RESIZE, this.resize)
|
|
106
|
+
this.handle.addEventListener("mousedown", this.mouseDown)
|
|
107
|
+
window.addEventListener("mouseup", this.mouseUp)
|
|
108
|
+
window.addEventListener("mousemove", this.mouseMove)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
off() {
|
|
112
|
+
emitter.off(EVENTS.APP_TICK, this.tick)
|
|
113
|
+
emitter.off(EVENTS.APP_RESIZE, this.resize)
|
|
114
|
+
this.handle.removeEventListener("mousedown", this.mouseDown)
|
|
115
|
+
window.removeEventListener("mouseup", this.mouseUp)
|
|
116
|
+
window.removeEventListener("mousemove", this.mouseMove)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
init() {
|
|
120
|
+
this.create()
|
|
121
|
+
this.setBounds()
|
|
122
|
+
this.on()
|
|
123
|
+
}
|
|
124
124
|
}
|
|
@@ -13,7 +13,7 @@ function normalizeTargets(splitTargets) {
|
|
|
13
13
|
export default class SplitonScroll {
|
|
14
14
|
constructor({
|
|
15
15
|
el,
|
|
16
|
-
|
|
16
|
+
splitTargets,
|
|
17
17
|
isReady,
|
|
18
18
|
reverse,
|
|
19
19
|
resize,
|
|
@@ -23,7 +23,7 @@ export default class SplitonScroll {
|
|
|
23
23
|
once = true,
|
|
24
24
|
}) {
|
|
25
25
|
this.element = el
|
|
26
|
-
this.targets = normalizeTargets(
|
|
26
|
+
this.targets = normalizeTargets(splitTargets)
|
|
27
27
|
|
|
28
28
|
this.splits = null
|
|
29
29
|
this.groups = null
|