Permalink
Browse files

fix(ui-sref-active): Add CSS class immediately (avoid delay)

- 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...
1 parent 4723fb5 commit 27eb5e930009f5f509213e2e0f5389ee8fd0bd42 @christopherthielen christopherthielen committed Nov 5, 2016
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/ng1/directives/stateDirectives.ts
@@ -461,6 +461,7 @@ let uiSrefActive = ['$state', '$stateParams', '$interpolate', '$transitions', '$
}
function addClass(el: IAugmentedJQuery, className: string) {
+ el.addClass(className);
$timeout(function () {
el.addClass(className);
});

0 comments on commit 27eb5e9

Please sign in to comment.