Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/silica.js
Original file line number Diff line number Diff line change
Expand Up @@ -633,17 +633,25 @@ window["Silica"] = {
if (protocolCheckRegex.exec(path) != null || path === "#" || path === "") {
return;
}

let defaultPrevented = false;
if (!this.dataset["noPreventDefault"]) {
defaultPrevented = true;
let noPreventDefault = this.dataset["noPreventDefault"] !== "true" ||
Silica.getValue(evt.currentTarget, this.dataset["noPreventDefault"]);
if (!noPreventDefault) {
evt.preventDefault();
defaultPrevented = true;
}
if (!this.dataset["noStopPropagation"]) {

let noStopProp = this.dataset["noStopPropagation"] !== "true" ||
Silica.getValue(evt.currentTarget, this.dataset["noStopPropagation"]);
if (!noStopProp) {
evt.stopPropagation();
}

// Readonly current target is only available when the event is handled thus
// pass along for client usage
PubSub.Pub("SiO2-HREF", evt, evt.currentTarget);

Silica.goTo(path);
return !defaultPrevented;
},
Expand Down