Skip to content

Commit b889418

Browse files
committed
Ensured jqlite compatibility
Modified logic to remove $.last() usage.
1 parent 915bc81 commit b889418

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/loading-bar.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,16 @@ angular.module('cfp.loadingBar', [])
204204

205205
$rootScope.$broadcast('cfpLoadingBar:started');
206206
started = true;
207+
208+
var $children = $parent.children();
207209

208210
if (includeBar) {
209-
$animate.enter(loadingBarContainer, $parent, $parent.children().length > 0 ? $parent.children().last() : null);
211+
212+
$animate.enter(loadingBarContainer, $parent, $children.length > 0 ? $children[$children.length - 1] : null);
210213
}
211214

212215
if (includeSpinner) {
213-
$animate.enter(spinner, $parent, $parent.children().length > 0 ? $parent.children().last() : null);
216+
$animate.enter(spinner, $parent, $children.length > 0 ? $children[$children.length - 1] : null);
214217
}
215218

216219
_set(startSize);

0 commit comments

Comments
 (0)