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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/src/js/components/Dropdown.js +27 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4240bb4020f2fa8d7a190f8026ba1bc9434e0a20ccc545156ff5935ad174f76c
4
- data.tar.gz: b0eef0c93430d3955695451c4db43fb350dfbd02afe9bf16e1a49d5df3f543e0
3
+ metadata.gz: d82d76600a18e4dddf1f90ec992290bc8a69926b5c692078f61d80bb0e68848f
4
+ data.tar.gz: 6619b2c4e47a4f7c05527ef852326c83a2d6d8049d0fb1db55156d701986874e
5
5
  SHA512:
6
- metadata.gz: b050adf27c9cf90bae213bd72144f227b2ff831c5c2b768380ee44473fa31f1b885032c66ff66c31874a78025a07f9f00238ced01ce861d68d644a2bd5f265a6
7
- data.tar.gz: e763f9218b0ea16809f0ad13f6027b06758e26604789f85b44e54341a3ae88ff0027abc36b6a3edfb5f8d29c90794cd959bc809e820a5f4f907e8a3b1eab0f91
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
- hideMenu() {
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
- // recover
61
- menu.dataset.place = this.place
62
- menu.dataset.align = this.align
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
  }
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.227
4
+ version: 0.0.228
5
5
  platform: ruby
6
6
  authors:
7
7
  - kmsheng