Skip to content

Commit

Permalink
Merge pull request chieffancypants#272 from jklaus/master
Browse files Browse the repository at this point in the history
Resolved issue with parentSelector when using a barren parent.
  • Loading branch information
chieffancypants committed Feb 19, 2016
2 parents 531e175 + b889418 commit de74337
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/loading-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,16 @@ angular.module('cfp.loadingBar', [])

$rootScope.$broadcast('cfpLoadingBar:started');
started = true;

var $children = $parent.children();

if (includeBar) {
$animate.enter(loadingBarContainer, $parent, angular.element($parent[0].lastChild));

$animate.enter(loadingBarContainer, $parent, $children.length > 0 ? $children[$children.length - 1] : null);
}

if (includeSpinner) {
$animate.enter(spinner, $parent, angular.element($parent[0].lastChild));
$animate.enter(spinner, $parent, $children.length > 0 ? $children[$children.length - 1] : null);
}

_set(startSize);
Expand Down

0 comments on commit de74337

Please sign in to comment.