Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix($location): hijack area links too #5933

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions src/ng/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -914,9 +914,10 @@ function $LocationProvider() {

var elm = jqLite(event.target);

// traverse the DOM up to find first A tag
while (nodeName_(elm[0]) !== 'a') {
// ignore rewriting if no A tag (reached root element, or no parent - removed from document)

// traverse the DOM up to find first A or AREA tag
while (nodeName_(elm[0]) !== 'a' && nodeName_(elm[0]) !== 'area') {
// ignore rewriting if no A or AREA tag (reached root element, or no parent - removed from document)
if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return;
}

Expand Down
Loading