beyond-rails 0.0.202 → 0.0.203

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c816a4705572ba5547e235aa306aa86bdb1a378f2e726305bfd72cab13817de1
4
- data.tar.gz: 6e3ce062286f84b8b390a7a905168a362f6aa2a41ae60aeff0d96d422c104b88
3
+ metadata.gz: 1557e4122feedf316b6b9d3963f9467f834283229005e62f955cd4bb2b12d339
4
+ data.tar.gz: c67ea2ae6c26b37bbb97f5acf4286241c3267d7e03331edee4459f23684a8531
5
5
  SHA512:
6
- metadata.gz: d1f3a3c4252e1a060e277a1adee4b7936f9d0ff4897f5f7cde4839e868b7a08b36a871965ab0fa6bd3b3fde096e562f60440f5b543c0fea7d3b04e59f983af71
7
- data.tar.gz: fc0200739a4d9eee637fbc3960e0be00a1ecca07d711a83ad54a516c7a19648e4a8feba55a217646b53dd733f5dd03e85b9ced0985aaf43ebca2f664e1fbb21d
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
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beyond-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.202
4
+ version: 0.0.203
5
5
  platform: ruby
6
6
  authors:
7
7
  - kmsheng