beyond-rails 0.0.294 → 0.0.295

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: b08747b155edbe7a1bfbff17baa4b437e6704b0a84ed2012811fbd92ce89611b
4
- data.tar.gz: 80ee5b2b5d1effda5d7292eaeaa7bdbdaa1343d0b72e075bee519e1bc44e8700
3
+ metadata.gz: 36652abb2afa4c3c6a9aedbe1d08b5048dd48640d0a8a077c32e76ec0614d81f
4
+ data.tar.gz: a9e338ed7f0b0cde7b26f425672f7e356456c31a82684ca7e952b19148a178fd
5
5
  SHA512:
6
- metadata.gz: 943a5f72642b6d25abcdf6e73796f820918df0112ccd2ba08732e62d69521e69bda92589208757fdf4de02818d6db62b7b59c933adf131d60cebc5dcfc77cc6c
7
- data.tar.gz: d687b61765ee12606d800f1a932a3b46f811efb5e87d13e8733d4b4096bbcf7ae1d7ca3bdf891fc2c22c6ec8c78e05c2d390b9c583f39e472ee3ac94a2029cfd
6
+ metadata.gz: a0951e8675a2f2eb791f6f0bd98dacdea22edc61cad5384c3c6ff4b588f06296bbf7382ad84cb22d1e23deb87c6ff29ce909c9d2c8b4d159a021549aac24b5e1
7
+ data.tar.gz: 674a58e6a09c7dd7bcd453e4e1f061642fabfa0ec9ce52539d8cc1a3c6a80432aece770737cd39b118446dbd5619e4134af489d5056937812fe2bddb7af1e19c
@@ -33,7 +33,6 @@ export default class SearchDropdown {
33
33
  this.items = []
34
34
  this.compositionStarted = false
35
35
  this.compositionJustEnded = false
36
- this.noDataMsgVisible = false
37
36
  this.loading = true
38
37
  this.init()
39
38
  }
@@ -184,12 +183,12 @@ export default class SearchDropdown {
184
183
  const { menuContent, items, selectedIndex } = this
185
184
  const { renderItem } = this.options
186
185
 
187
- const menuItems = items.map((item, i) => {
186
+ let menuItems = items.map((item, i) => {
188
187
  return renderItem(item, i, (selectedIndex === i), items)
189
188
  })
190
189
 
191
- if (this.noDataMsgVisible) {
192
- menuItems.unshift(`<div class="search-dropdown-menu-item">${this.noDataMsg}</div>`)
190
+ if (menuItems.length === 0) {
191
+ menuItems = [`<div class="search-dropdown-menu-item">${this.noDataMsg}</div>`]
193
192
  }
194
193
 
195
194
  menuContent.innerHTML = menuItems.join('')
@@ -226,7 +225,6 @@ export default class SearchDropdown {
226
225
  }
227
226
  this.resetSelectedIndex()
228
227
  this.lastKeyword = keyword
229
- this.noDataMsgVisible = false
230
228
  this.setItems([])
231
229
 
232
230
  this.setLoading(true)
@@ -235,10 +233,6 @@ export default class SearchDropdown {
235
233
 
236
234
  this.setLoading(false)
237
235
 
238
- if (items.length === 0) {
239
- this.noDataMsgVisible = true
240
- }
241
-
242
236
  if (this.lastKeyword === this.input.value) {
243
237
  this.setItems(items)
244
238
  }
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.294
4
+ version: 0.0.295
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-07-08 00:00:00.000000000 Z
12
+ date: 2021-07-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sassc