@madj2k/fe-frontend-kit 2.0.18 → 2.0.19
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
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @author Steffen Kroggel <developer@steffenkroggel.de>
|
|
14
14
|
* @copyright 2025 Steffen Kroggel
|
|
15
|
-
* @version 2.0.
|
|
15
|
+
* @version 2.0.3
|
|
16
16
|
* @license GNU General Public License v3.0
|
|
17
17
|
* @see https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
18
18
|
*
|
|
@@ -235,17 +235,12 @@ class Madj2kScrolling {
|
|
|
235
235
|
const href = event.currentTarget.getAttribute('href');
|
|
236
236
|
if (!href) return;
|
|
237
237
|
|
|
238
|
-
|
|
239
|
-
const
|
|
240
|
-
const currentUrl = window.location.origin + window.location.pathname;
|
|
241
|
-
const isSamePage = (
|
|
242
|
-
href.startsWith('#') ||
|
|
243
|
-
(window.location.origin + linkPath) === currentUrl
|
|
244
|
-
);
|
|
238
|
+
const url = new URL(href, window.location.origin); // wandelt auch relative URLs korrekt um
|
|
239
|
+
const isSamePage = url.pathname === window.location.pathname;
|
|
245
240
|
|
|
246
|
-
if (isSamePage && hash) {
|
|
241
|
+
if (isSamePage && url.hash) {
|
|
247
242
|
event.preventDefault();
|
|
248
|
-
const anchor = document.getElementById(hash);
|
|
243
|
+
const anchor = document.getElementById(url.hash.substring(1));
|
|
249
244
|
if (anchor) scrollToElement(anchor);
|
|
250
245
|
}
|
|
251
246
|
};
|