Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes all instances of $animate.enter() to follow angular 1.3.x semantics without breaking 1.2.x #170

Merged
merged 2 commits into from
Feb 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/loading-bar.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* angular-loading-bar v0.6.0
* https://chieffancypants.github.io/angular-loading-bar
* Copyright (c) 2014 Wes Cruver
* Copyright (c) 2015 Wes Cruver
* License: MIT
*/

Expand Down
6 changes: 3 additions & 3 deletions build/loading-bar.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* angular-loading-bar v0.6.0
* https://chieffancypants.github.io/angular-loading-bar
* Copyright (c) 2014 Wes Cruver
* Copyright (c) 2015 Wes Cruver
* License: MIT
*/
/*
Expand Down Expand Up @@ -200,11 +200,11 @@ angular.module('cfp.loadingBar', [])
started = true;

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

if (includeSpinner) {
$animate.enter(spinner, $parent);
$animate.enter(spinner, $parent, angular.element($parent[0].lastChild));
}

_set(startSize);
Expand Down
2 changes: 1 addition & 1 deletion build/loading-bar.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build/loading-bar.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/loading-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ angular.module('cfp.loadingBar', [])
started = true;

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

if (includeSpinner) {
$animate.enter(spinner, $parent);
$animate.enter(spinner, $parent, angular.element($parent[0].lastChild));
}

_set(startSize);
Expand Down
16 changes: 16 additions & 0 deletions test/loading-bar-interceptor.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,22 @@ describe 'loadingBarInterceptor Service', ->
$httpBackend.flush()
$timeout.flush()

it 'should insert the loadingbar as the last children of the parent container', inject (cfpLoadingBar) ->
$httpBackend.expectGET(endpoint).respond response
$httpBackend.expectGET(endpoint).respond response
$http.get(endpoint)
$http.get(endpoint)

$httpBackend.flush(1)
$timeout.flush() # flush the latencyThreshold timeout

parent = $document.find(cfpLoadingBar.parentSelector)[0]
children = parent.childNodes
expect(children[children.length - 1].id).toBe 'loading-bar-spinner'
expect(children[children.length - 2].id).toBe 'loading-bar'

$httpBackend.flush()
$timeout.flush()

it 'should remove the loading bar when all requests have been received', inject (cfpLoadingBar) ->
$httpBackend.expectGET(endpoint).respond response
Expand Down