nodebb-theme-harmony 1.2.74 → 1.2.75

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-theme-harmony",
3
- "version": "1.2.74",
3
+ "version": "1.2.75",
4
4
  "nbbpm": {
5
5
  "compatibility": "^3.7.0"
6
6
  },
package/public/harmony.js CHANGED
@@ -254,22 +254,17 @@ $(document).ready(function () {
254
254
  return;
255
255
  }
256
256
  ['notifications', 'chat'].forEach((type) => {
257
- const countEl = document.querySelector(`[component="${type}/count"]`);
258
- if (!countEl) {
257
+ const countEl = $(`nav.sidebar [component="${type}/count"]`).first();
258
+ if (!countEl.length) {
259
259
  return;
260
260
  }
261
- const count = parseInt(countEl.innerText, 10);
261
+ const count = parseInt(countEl.text(), 10);
262
262
  if (count > 1) {
263
- const listEls = document.querySelectorAll(`[component="${type}/list"]`);
264
- listEls.forEach((listEl) => {
265
- const placeholder = listEl.querySelector('*');
266
- if (placeholder) {
267
- for (let x = 0; x < count - 1; x++) {
268
- const cloneEl = placeholder.cloneNode(true);
269
- listEl.insertBefore(cloneEl, placeholder);
270
- }
271
- }
272
- });
263
+ const placeholder = $(`nav.sidebar [component="${type}/list"]`).children().first();
264
+ for (let x = 0; x < count - 1; x++) {
265
+ const cloneEl = placeholder.clone(true);
266
+ cloneEl.insertAfter(placeholder);
267
+ }
273
268
  }
274
269
  });
275
270
  }
@@ -20,8 +20,8 @@
20
20
  {{{ each ./children }}}
21
21
  {{{ if !./isSection }}}
22
22
  <span class="category-children-item small">
23
- <div class="d-flex align-items-center gap-1">
24
- <i class="fa fa-fw fa-caret-right text-primary align-self-start" style="line-height: var(--bs-body-line-height);"></i>
23
+ <div class="d-flex gap-1">
24
+ <i class="fa fa-fw fa-caret-right text-primary" style="line-height: var(--bs-body-line-height);"></i>
25
25
  <a href="{{{ if ./link }}}{./link}{{{ else }}}{config.relative_path}/category/{./slug}{{{ end }}}" class="text-reset fw-semibold">{./name}</a>
26
26
  </div>
27
27
  </span>