Skip to content

Commit

Permalink
Merge pull request #170 from assisrafael/master
Browse files Browse the repository at this point in the history
Changes all instances of $animate.enter() to follow angular 1.3.x semantics without breaking 1.2.x
  • Loading branch information
chieffancypants committed Feb 17, 2015
2 parents 25f7e26 + 718d25c commit 7ce8a1f
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 9 deletions.
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 @@ -197,11 +197,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

0 comments on commit 7ce8a1f

Please sign in to comment.