waibu-maps 2.7.4 → 2.7.5

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.
@@ -1,8 +1,8 @@
1
- <c:div dim="height:100" flex="align-items:center justify-content:center" data-bs-toggle="dropdown" data-bs-auto-close="outside">
1
+ <c:div @click="{%= click %}" dim="height:100" flex="align-items:center justify-content:center" data-bs-toggle="dropdown" data-bs-auto-close="outside">
2
2
  {% if (image !== '') { %}
3
3
  <c:img src="{%= image %}" />
4
4
  {% } else { %}
5
- <c:icon oname="{%= icon %}" @click="{%= click %}" />
5
+ <c:icon oname="{%= icon %}" />
6
6
  {% } %}
7
7
  </c:div>
8
8
  <c:div class="dropdown-menu">
@@ -52,8 +52,7 @@ async function controlGroup () {
52
52
  const el = evt.target.closest('button')
53
53
  if (!el) return
54
54
  const menu = el.querySelector('.dropdown-menu .loading')
55
- if (!menu) return
56
- if (menu.children.length > 0) return
55
+ if (!menu || menu.children.length > 0) return
57
56
  const setting = el.getAttribute('setting') ? ('setting="' + el.getAttribute('setting') + '"') : ''
58
57
  const options = { selector: menu, checkChild: true }
59
58
  await wmpa.replaceWithComponent('<c:' + el.getAttribute('component') + ' ' + setting + ' />', options)
@@ -58,11 +58,13 @@ async function controlSearch () {
58
58
  }
59
59
  `, `
60
60
  async ${prefix}Populate () {
61
+ const selector = '#${id} .input-group .dropdown-menu'
62
+ if (document.querySelector(selector).children.length > 0) return
61
63
  const feeds = await ${this.params.attr.feed}() ?? []
62
64
  feeds.unshift({ code: 'latLng', name: 'gotoLatLng', feed: { id: 'latLng', cmpLabel: 'latLng' } })
63
65
  this.$store.mapSearch.feeds = feeds
64
66
  const body = feeds.map(feed => '<c:dropdown-item :class="$store.mapSearch.feed === $el.getAttribute(\\'data-code-feedid\\') ? \\'active\\' : \\'\\'" data-code-feedid="' + feed.code + ':' + feed.feed.id + '" t:content="' + feed.feed.cmpLabel + '" @click="$store.mapSearch.feed = \\'' + feed.code + ':' + feed.feed.id + '\\'"/>')
65
- const options = { selector: '#${id} .input-group .dropdown-menu', wrapper: 'div', checkChild: true }
67
+ const options = { selector, wrapper: 'div', checkChild: true }
66
68
  await wmpa.addComponent(body, options)
67
69
  if (!this.$store.mapSearch.feed) this.$store.mapSearch.feed = feeds[0].code + ':' + feeds[0].feed.id
68
70
  const html = this.$store.mapSearch.recent ?? ''
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-maps",
3
- "version": "2.7.4",
3
+ "version": "2.7.5",
4
4
  "description": "Maps for Waibu MPA",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-11-12
4
+
5
+ - [2.7.5] Bug fix in `control-search.js` widget
6
+ - [2.7.5] Bug fix in `control-group.js` widget
7
+
3
8
  ## 2026-10-27
4
9
 
5
10
  - [2.7.4] Bug fix in `getPosts()`