beyond-rails 1.0.1 → 1.0.2
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/components/Dropdown.js +9 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d92b118dbf4ed4cb5c041cfe46ba20762bb42860576d77348ee235fcc96b3792
|
|
4
|
+
data.tar.gz: f981bdb20cf4262c65f1cb4ff147887e102be054acea8b59c83bc338877cfae6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '009339b8c94ac51ff8b1173a0a94b06dcd96864c4c50fc9b327da0a2a61be534d8081d1b3d1e84f2382ceee4b115ca5d368fe284cf47856ab087eb2bc8aee0a3'
|
|
7
|
+
data.tar.gz: 29e59d32a6a1825e88f719d78bffa6019b3de4e2cbe3bdc27fa46b9ca5857e48a1d6520d932f7670032723a4d1b5bbb6d1e6c28dcc29f31a57bbf337d526b4d5
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import getFloatedTargetPos from '../utils/getFloatedTargetPos'
|
|
2
2
|
import supportDom from '../decorators/supportDom'
|
|
3
|
-
import { isFunction, toPixel, throttle } from '../utils'
|
|
3
|
+
import { isFunction, toPixel, throttle, noop } from '../utils'
|
|
4
4
|
|
|
5
5
|
@supportDom
|
|
6
6
|
export default class Dropdown {
|
|
@@ -14,6 +14,7 @@ export default class Dropdown {
|
|
|
14
14
|
this.defaultTextNode = this.getDefaultTextNode(dom, options.textIndex)
|
|
15
15
|
this.defaultText = this.defaultTextNode ? this.defaultTextNode.textContent.trim() : ''
|
|
16
16
|
this.backdropMode = options.backdropMode || 'auto'
|
|
17
|
+
this.hidden = options.hidden || noop
|
|
17
18
|
this.init()
|
|
18
19
|
}
|
|
19
20
|
|
|
@@ -136,7 +137,12 @@ export default class Dropdown {
|
|
|
136
137
|
})
|
|
137
138
|
}
|
|
138
139
|
|
|
139
|
-
this.addEvent(this.dom, 'click', () =>
|
|
140
|
+
this.addEvent(this.dom, 'click', () => {
|
|
141
|
+
this.toggleMenu()
|
|
142
|
+
if (! this.isMenuVisible) {
|
|
143
|
+
this.hidden()
|
|
144
|
+
}
|
|
145
|
+
})
|
|
140
146
|
|
|
141
147
|
this.addEvent(document, 'click', event => {
|
|
142
148
|
if (! this.isMenuVisible) {
|
|
@@ -148,6 +154,7 @@ export default class Dropdown {
|
|
|
148
154
|
// is backdrop
|
|
149
155
|
if ((event.target !== this.dom) && (! this.dom.contains(event.target))) {
|
|
150
156
|
this.hideMenu()
|
|
157
|
+
this.hidden()
|
|
151
158
|
}
|
|
152
159
|
})
|
|
153
160
|
|
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: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- kmsheng
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2021-
|
|
12
|
+
date: 2021-11-02 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: sassc
|