beyond-rails 0.0.202 → 0.0.203
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.
- checksums.yaml +4 -4
- data/src/js/decorators/supportDom.js +24 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1557e4122feedf316b6b9d3963f9467f834283229005e62f955cd4bb2b12d339
|
4
|
+
data.tar.gz: c67ea2ae6c26b37bbb97f5acf4286241c3267d7e03331edee4459f23684a8531
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da39afee87b75d9a43d8c1ad4c52ea7a16310354a93f7e90f02faad92fce0665cc8777d8f98da3d9166bb5e763cb21a3b4e70626acde486c4645cdfa1fd8b252
|
7
|
+
data.tar.gz: 73fc6222597d8ea5e21b5932199a28695c6c387bfd06ee629ee59caee39ec2e768d057154bbb35084cdbf62fd6009d105222d9d288929f2815ba70b2b65c9f36
|
@@ -6,6 +6,10 @@ export default function supportDom(target) {
|
|
6
6
|
return class extends target {
|
7
7
|
|
8
8
|
init() {
|
9
|
+
if (this.beyondBound) {
|
10
|
+
return
|
11
|
+
}
|
12
|
+
this.markBound()
|
9
13
|
this._listeners = []
|
10
14
|
this._externalListeners = []
|
11
15
|
if (isFunction(super.init)) {
|
@@ -14,6 +18,25 @@ export default function supportDom(target) {
|
|
14
18
|
createdComponents.push(this)
|
15
19
|
}
|
16
20
|
|
21
|
+
get beyondBound() {
|
22
|
+
const { dom } = this
|
23
|
+
return dom && (dom.dataset.beyondBound === 'true')
|
24
|
+
}
|
25
|
+
|
26
|
+
markBound() {
|
27
|
+
const { dom } = this
|
28
|
+
if (dom) {
|
29
|
+
dom.dataset.beyondBound = true
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
markUnbind() {
|
34
|
+
const { dom } = this
|
35
|
+
if (dom) {
|
36
|
+
delete dom.dataset.beyondBound
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
17
40
|
on(name, func) {
|
18
41
|
this._externalListeners.push({ name, func })
|
19
42
|
}
|
@@ -38,6 +61,7 @@ export default function supportDom(target) {
|
|
38
61
|
destroy() {
|
39
62
|
this._externalListeners.length = 0
|
40
63
|
this.removeEvents()
|
64
|
+
this.markUnbind()
|
41
65
|
if (isFunction(super.destroy)) {
|
42
66
|
super.destroy()
|
43
67
|
}
|