Skip to content

Commit 44fbda5

Browse files
bump version 0.5.2
1 parent 8387cdb commit 44fbda5

File tree

7 files changed

+26
-13
lines changed

7 files changed

+26
-13
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Changelog
22
==========
33

4+
## 0.5.2:
5+
Fixes for Angular 1.3 breaking changes:
6+
- Circular dependencies: ([#98](https://github.com/chieffancypants/angular-loading-bar/issues/98)), ([#101](https://github.com/chieffancypants/angular-loading-bar/pull/101))
7+
- $animate no longer accepts callbacks: ([#102](https://github.com/chieffancypants/angular-loading-bar/pull/102))
8+
49
## 0.5.1
510
- Reworked cache logic to allow cache:true ([#96](https://github.com/chieffancypants/angular-loading-bar/pull/96))
611

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-loading-bar",
3-
"version": "0.5.1",
3+
"version": "0.5.2",
44
"main": [
55
"build/loading-bar.js",
66
"build/loading-bar.css"

build/loading-bar.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* angular-loading-bar v0.5.1
2+
* angular-loading-bar v0.5.2
33
* https://chieffancypants.github.io/angular-loading-bar
44
* Copyright (c) 2014 Wes Cruver
55
* License: MIT

build/loading-bar.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* angular-loading-bar v0.5.1
2+
* angular-loading-bar v0.5.2
33
* https://chieffancypants.github.io/angular-loading-bar
44
* Copyright (c) 2014 Wes Cruver
55
* License: MIT
@@ -163,8 +163,8 @@ angular.module('cfp.loadingBar', [])
163163
this.parentSelector = 'body';
164164
this.spinnerTemplate = '<div id="loading-bar-spinner"><div class="spinner-icon"></div></div>';
165165

166-
this.$get = ['$document', '$timeout', '$animate', '$rootScope', function ($document, $timeout, $animate, $rootScope) {
167-
166+
this.$get = ['$injector', '$document', '$timeout', '$rootScope', function ($injector, $document, $timeout, $rootScope) {
167+
var $animate;
168168
var $parentSelector = this.parentSelector,
169169
loadingBarContainer = angular.element('<div id="loading-bar"><div class="bar"><div class="peg"></div></div></div>'),
170170
loadingBar = loadingBarContainer.find('div').eq(0),
@@ -183,6 +183,10 @@ angular.module('cfp.loadingBar', [])
183183
* Inserts the loading bar element into the dom, and sets it to 2%
184184
*/
185185
function _start() {
186+
if (!$animate) {
187+
$animate = $injector.get('$animate');
188+
}
189+
186190
var $parent = $document.find($parentSelector);
187191
$timeout.cancel(completeTimeout);
188192

@@ -266,22 +270,26 @@ angular.module('cfp.loadingBar', [])
266270
return status;
267271
}
268272

269-
function _complete_animation() {
273+
function _completeAnimation() {
270274
status = 0;
271275
started = false;
272276
}
273277

274278
function _complete() {
279+
if (!$animate) {
280+
$animate = $injector.get('$animate');
281+
}
282+
275283
$rootScope.$broadcast('cfpLoadingBar:completed');
276284
_set(1);
277285

278286
$timeout.cancel(completeTimeout);
279287

280288
// Attempt to aggregate any start/complete calls within 500ms:
281289
completeTimeout = $timeout(function() {
282-
var promise = $animate.leave(loadingBarContainer, _complete_animation);
283-
if(promise){
284-
promise.then(_complete_animation);
290+
var promise = $animate.leave(loadingBarContainer, _completeAnimation);
291+
if (promise && promise.then) {
292+
promise.then(_completeAnimation);
285293
}
286294
$animate.leave(spinner);
287295
}, 500);

build/loading-bar.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/loading-bar.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-loading-bar",
3-
"version": "0.5.1",
3+
"version": "0.5.2",
44
"description": "An automatic loading bar for AngularJS",
55
"main": "src/loading-bar.js",
66
"directories": {

0 commit comments

Comments
 (0)