beyond-rails 0.0.227 → 0.0.228
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/src/js/components/Dropdown.js +27 -5
- 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: d82d76600a18e4dddf1f90ec992290bc8a69926b5c692078f61d80bb0e68848f
|
4
|
+
data.tar.gz: 6619b2c4e47a4f7c05527ef852326c83a2d6d8049d0fb1db55156d701986874e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bcf523d47193022e785bf994ce5a186683211fa1afd5007cdf31699fb9d6d0ff53bdc81b1fde8edd0511c17b2bc51c657c28da4cf9d0b4576b1786f7fee5cd8
|
7
|
+
data.tar.gz: 54c2534a83ffb83f4281920d1fa2d7a688beda57168282ce253bc53afb48df596121dfb04b05cf611adc26e99c6e089b09d233d4ec3d9873260b38faca752160
|
@@ -51,15 +51,28 @@ export default class Dropdown {
|
|
51
51
|
this.addEvents()
|
52
52
|
}
|
53
53
|
|
54
|
-
|
54
|
+
restoreMenuAttrs() {
|
55
|
+
const { menu, place, align } = this
|
56
|
+
if (place) {
|
57
|
+
menu.dataset.place = place
|
58
|
+
}
|
59
|
+
if (align) {
|
60
|
+
menu.dataset.align = align
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
hideMenu(immediate = false) {
|
55
65
|
const { menu } = this
|
56
66
|
menu.style.transform = 'scale(.8)'
|
57
67
|
menu.style.opacity = 0
|
58
|
-
setTimeout(() => menu.remove(), 300)
|
59
68
|
|
60
|
-
|
61
|
-
|
62
|
-
|
69
|
+
if (immediate) {
|
70
|
+
menu.remove()
|
71
|
+
}
|
72
|
+
else {
|
73
|
+
setTimeout(() => menu.remove(), 300)
|
74
|
+
}
|
75
|
+
this.restoreMenuAttrs()
|
63
76
|
this.isMenuVisible = false
|
64
77
|
}
|
65
78
|
|
@@ -145,4 +158,13 @@ export default class Dropdown {
|
|
145
158
|
this.adjustMenuPos()
|
146
159
|
}, 300))
|
147
160
|
}
|
161
|
+
|
162
|
+
destroy() {
|
163
|
+
// prevent next re-bind error
|
164
|
+
const { menu } = this
|
165
|
+
if (menu) {
|
166
|
+
this.hideMenu(true)
|
167
|
+
document.body.appendChild(menu)
|
168
|
+
}
|
169
|
+
}
|
148
170
|
}
|