@saltcorn/sbadmin2 1.1.4-beta.9 → 1.2.0-beta.0

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.
Files changed (2) hide show
  1. package/index.js +5 -4
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -29,6 +29,7 @@ const {
29
29
  headersInHead,
30
30
  headersInBody,
31
31
  show_icon,
32
+ activeChecker,
32
33
  } = require("@saltcorn/markup/layout_utils");
33
34
  const db = require("@saltcorn/data/db");
34
35
  const { isNode } = require("@saltcorn/data/utils");
@@ -98,13 +99,13 @@ const logit = (x, s) => {
98
99
  * @returns {boolean}
99
100
  */
100
101
  const active = (currentUrl, item) =>
101
- (item.link && currentUrl.startsWith(item.link)) ||
102
- (item.altlinks && item.altlinks.some((l) => currentUrl.startsWith(l))) ||
102
+ (item.link && activeChecker(item.link, currentUrl)) ||
103
+ (item.altlinks && item.altlinks.some((l) => activeChecker(l, currentUrl))) ||
103
104
  (item.subitems &&
104
105
  item.subitems.some(
105
106
  (si) =>
106
- (si.link && currentUrl.startsWith(si.link)) ||
107
- (si.altlinks && si.altlinks.some((l) => currentUrl.startsWith(l)))
107
+ (si.link && activeChecker(si.link, currentUrl)) ||
108
+ (si.altlinks && si.altlinks.some((l) => activeChecker(l, currentUrl)))
108
109
  ));
109
110
 
110
111
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saltcorn/sbadmin2",
3
- "version": "1.1.4-beta.9",
3
+ "version": "1.2.0-beta.0",
4
4
  "description": "SB Admin 2 layout plugin",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -9,8 +9,8 @@
9
9
  "clean": "echo \"Error: no TypeScript support yet\""
10
10
  },
11
11
  "dependencies": {
12
- "@saltcorn/data": "1.1.4-beta.9",
13
- "@saltcorn/markup": "1.1.4-beta.9"
12
+ "@saltcorn/data": "1.2.0-beta.0",
13
+ "@saltcorn/markup": "1.2.0-beta.0"
14
14
  },
15
15
  "author": "Tom Nielsen",
16
16
  "license": "MIT",