Skip to content

Commit

Permalink
fix(ui-sref-active): Add CSS class immediately (avoid delay)
Browse files Browse the repository at this point in the history
- a timeout is used to allow the CSS class to be added in an ng-repeat, where angular resets the class="" attr from the expression
- also add the class without a timeout, to avoid flicker

Closes #2503
  • Loading branch information
christopherthielen committed Nov 5, 2016
1 parent 4723fb5 commit 27eb5e9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/ng1/directives/stateDirectives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ let uiSrefActive = ['$state', '$stateParams', '$interpolate', '$transitions', '$
}

function addClass(el: IAugmentedJQuery, className: string) {
el.addClass(className);
$timeout(function () {
el.addClass(className);
});
Expand Down

0 comments on commit 27eb5e9

Please sign in to comment.