waibu-maps 2.7.3 → 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)
@@ -76,6 +76,7 @@ async function controlNewsticker () {
76
76
  const el = document.querySelector('.maplibregl-ctrl-newsticker .content')
77
77
  el.innerHTML = ''
78
78
  this.posts = await wmpa.fetchApi('/cms/post', { headers: { 'X-Attachments': 'true' } }, { limit: 10 })
79
+ if (this.posts.length === 0) return
79
80
  this.posts.forEach(post => {
80
81
  const li = document.createElement('li')
81
82
  const a = document.createElement('a')
@@ -102,7 +103,7 @@ async function controlNewsticker () {
102
103
  this.newstickerDt()
103
104
  setInterval(this.newstickerDt, 1000)
104
105
  await this.getPosts()
105
- setInterval(this.getPosts, 5 * 60 * 1000)
106
+ setInterval(this.getPosts, 3 * 60 * 1000)
106
107
  `)
107
108
 
108
109
  const ui = await minify(await this.component.buildSentence(`
@@ -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.3",
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,8 +1,17 @@
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
+
8
+ ## 2026-10-27
9
+
10
+ - [2.7.4] Bug fix in `getPosts()`
11
+
3
12
  ## 2026-10-25
4
13
 
5
- - [2.7.0] Refactor getPosts()
14
+ - [2.7.0] Refactor `getPosts()`
6
15
  - [2.7.1] Bug fix some positioning & dimensions
7
16
  - [2.7.2] Bug fix in timer
8
17
  - [2.7.3] Bug fix in image dimension