beyond-rails 0.0.216 → 0.0.217

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: 9fe01a2e2f9bee54d4f3f5e44b26bca8b223666c0749383fcde789ffae9fca6c
4
- data.tar.gz: 56434ea193d4294f2c74d70ab41acfc85fa531b53ec8888d862d3729861a56de
3
+ metadata.gz: dc8e595696f351d27825c440fc48825dc0360b4a0aeeb23d8ff88f51d70e7794
4
+ data.tar.gz: f65dc6990f6962438dc867f2eb6f29f50658f8ac474b52cb13765621ffbf358a
5
5
  SHA512:
6
- metadata.gz: d64f68417f19ff8e8640a052d917df93eb49dd05b87c6c727ea0ed42056ad45d34258ba2396f3aa7da5a5ea4c03879a4448f934fdf83fe24e885484495351dcf
7
- data.tar.gz: 9226d6dadae03caf44bf49f13b0c3545ac3ecab2af677704c4be0a5d2bf18a847d65e77db81bbe51ab03d3ac6ed327f4ef790694c0418e58396053b6f7483463
6
+ metadata.gz: d5b3863f1fd9a07e8ccc2c086c5ca2292e9c40a2e40fbd860935dbff10378f3421d7294be5557c894affae7a5f665a63b1bf4a11de0dfc5549174b9947a58a08
7
+ data.tar.gz: f5319191d5a32812c4a18ecd28e1bce0d56fa1f16c69f72c7db633d805d1a61edc6fad8b589658f61e8bd604882704ec1e6d589e6ea9faf11ceadf0469f11ddc
@@ -1,21 +1,11 @@
1
1
  import { isFunction } from '../utils'
2
2
  import createdComponents from '../consts/createdComponents'
3
3
 
4
- const domMap = new Map()
5
-
6
4
  export default function supportDom(target) {
7
5
 
8
- const targetName = target.name
9
-
10
6
  return class extends target {
11
7
 
12
8
  init() {
13
- if (this.classNameUsed) {
14
- console.warn(`This dom has already been initialized by ${targetName}`, this.dom)
15
- return
16
- }
17
- this.setClassNameByDom(target)
18
-
19
9
  this._listeners = []
20
10
  this._externalListeners = []
21
11
  if (isFunction(super.init)) {
@@ -24,40 +14,6 @@ export default function supportDom(target) {
24
14
  createdComponents.push(this)
25
15
  }
26
16
 
27
- get classNameUsed() {
28
- if (this._skipDomChecking) {
29
- return false
30
- }
31
- const classnames = domMap.get(this.dom) || []
32
- return classnames.includes(targetName)
33
- }
34
-
35
- setClassNameByDom(target) {
36
- const { dom } = this
37
- if (dom) {
38
- const classes = domMap.get(dom) || []
39
- classes.push(targetName)
40
- domMap.set(dom, classes)
41
- }
42
- }
43
-
44
- deleteClassNameByDom(target) {
45
- const { dom } = this
46
- if (! dom) {
47
- return
48
- }
49
- const { name } = target
50
- const classnames = (domMap.get(dom) || [])
51
- .filter(classname => classname !== name)
52
-
53
- if (classnames.length === 0) {
54
- domMap.delete(dom)
55
- }
56
- else {
57
- domMap.set(dom, classnames)
58
- }
59
- }
60
-
61
17
  on(name, func) {
62
18
  this._externalListeners.push({ name, func })
63
19
  }
@@ -80,7 +36,6 @@ export default function supportDom(target) {
80
36
  }
81
37
 
82
38
  destroy() {
83
- this.deleteClassNameByDom(target)
84
39
  this._externalListeners.length = 0
85
40
  this.removeEvents()
86
41
  if (isFunction(super.destroy)) {
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.216
4
+ version: 0.0.217
5
5
  platform: ruby
6
6
  authors:
7
7
  - kmsheng