@keenmate/svelte-spa-router 1.0.5 → 1.0.6
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/Router.svelte +5 -4
- package/package.json +1 -1
package/Router.svelte
CHANGED
|
@@ -274,21 +274,22 @@
|
|
|
274
274
|
scrollstateHistoryHandler(ev.currentTarget.getAttribute("href"))
|
|
275
275
|
}
|
|
276
276
|
} else {
|
|
277
|
-
console.log("Handling link click event")
|
|
277
|
+
// console.log("Handling link click event")
|
|
278
278
|
const linkTarget = ev.target.getAttribute("target")
|
|
279
279
|
if (linkTarget && linkTarget !== "_self") {
|
|
280
|
-
console.log("Link has special target attr, opening href instead")
|
|
280
|
+
// console.log("Link has special target attr, opening href instead")
|
|
281
|
+
ev.preventDefault()
|
|
281
282
|
// prevent pushState when link is perhaps going outside of this window
|
|
282
283
|
window.open(node.getAttribute("href"), linkTarget)
|
|
283
284
|
|
|
284
285
|
return
|
|
285
286
|
}
|
|
286
287
|
if (ev.ctrlKey || ev.shiftKey || ev.metaKey) {
|
|
287
|
-
console.log("Modifier key has been held while opening link, keeping behaviour intact")
|
|
288
|
+
// console.log("Modifier key has been held while opening link, keeping behaviour intact")
|
|
288
289
|
return
|
|
289
290
|
}
|
|
290
291
|
|
|
291
|
-
console.log("Custom link operation is in place")
|
|
292
|
+
// console.log("Custom link operation is in place")
|
|
292
293
|
ev.preventDefault()
|
|
293
294
|
|
|
294
295
|
const shouldReplace = typeof opts !== "string" && opts.shouldReplace
|