Skip to content

Commit

Permalink
fix($StateRefDirective): resolve missing support for svg anchor eleme…
Browse files Browse the repository at this point in the history
…nts #1667
  • Loading branch information
martinoss committed Jan 5, 2015
1 parent 7e38adb commit 0149a7b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/stateDirectives.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,12 @@ function $StateRefDirective($state, $timeout) {
link: function(scope, element, attrs, uiSrefActive) {
var ref = parseStateRef(attrs.uiSref, $state.current.name);
var params = null, url = null, base = stateContext(element) || $state.$current;
var newHref = null, isAnchor = element.prop("tagName") === "A";
// SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.
var hrefKind = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ?
'xlink:href' : 'href';
var newHref = null, isAnchor = element.prop("tagName").toUpperCase() === "A";
var isForm = element[0].nodeName === "FORM";
var attr = isForm ? "action" : "href", nav = true;
var attr = isForm ? "action" : hrefKind, nav = true;

var options = { relative: base, inherit: true };
var optionsOverride = scope.$eval(attrs.uiSrefOpts) || {};
Expand Down

0 comments on commit 0149a7b

Please sign in to comment.