Skip to content

Commit

Permalink
apply fix for angular/angular.js#5198
Browse files Browse the repository at this point in the history
  • Loading branch information
jstrachan authored and gashcrumb committed Jan 27, 2014
1 parent a983da1 commit f554f07
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions hawtio-web/src/main/webapp/lib/angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -6143,17 +6143,21 @@ function $LocationProvider(){
if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return;
}

// fix for https://github.com/angular/angular.js/issues/5198
var absHref = elm.prop('href');
var rewrittenUrl = $location.$$rewrite(absHref);

if (absHref && !elm.attr('target') && rewrittenUrl && !event.isDefaultPrevented()) {
event.preventDefault();
if (rewrittenUrl != $browser.url()) {
// update location manually
$location.$$parse(rewrittenUrl);
$rootScope.$apply();
// hack to work around FF6 bug 684208 when scenario runner clicks on links
window.angular['ff-684208-preventDefault'] = true;
// test for string to avoid SVGAnimatedString
if (absHref && angular.isString(absHref)) {
var rewrittenUrl = $location.$$rewrite(absHref);

if (!elm.attr('target') && rewrittenUrl && !event.isDefaultPrevented()) {
event.preventDefault();
if (rewrittenUrl != $browser.url()) {
// update location manually
$location.$$parse(rewrittenUrl);
$rootScope.$apply();
// hack to work around FF6 bug 684208 when scenario runner clicks on links
window.angular['ff-684208-preventDefault'] = true;
}
}
}
});
Expand Down

0 comments on commit f554f07

Please sign in to comment.