Skip to content

Commit

Permalink
fix bug with clicking on elements embedded in anchor tags
Browse files Browse the repository at this point in the history
  • Loading branch information
AUTplayed committed Aug 3, 2019
1 parent 085d733 commit 005bb7f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ldf.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,18 @@ var ldf = {
},
listener: function (e) {
e.preventDefault();
ldf.nav(e.target.getAttribute("href"));
var loc = "";
if (e.target.tagName === "A") {
loc = e.target.getAttribute("href");
} else {
for (var i = 1; i < e.path.length; i++) {
if (e.path[i].tagName === "A") {
loc = e.path[i].getAttribute("href");
break;
}
}
}
ldf.nav(loc);
},
request: function (loc, cb) {
var req = new XMLHttpRequest();
Expand Down

0 comments on commit 005bb7f

Please sign in to comment.