Skip to content
This repository was archived by the owner on Sep 19, 2024. It is now read-only.

Commit 7072c91

Browse files
committed
Merge branch 'release/1.3.2'
2 parents d7cbd35 + 96fc541 commit 7072c91

File tree

7 files changed

+15
-26
lines changed

7 files changed

+15
-26
lines changed

angular-idle.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*** Directives and services for responding to idle users in AngularJS
22
* @author Mike Grabski <me@mikegrabski.com>
3-
* @version v1.3.1
3+
* @version v1.3.2
44
* @link https://github.com/HackedByChinese/ng-idle.git
55
* @license MIT
66
*/
@@ -42,17 +42,17 @@ angular.module('ngIdle.keepalive', [])
4242
ping: null
4343
};
4444

45-
function handleResponse(data, status) {
46-
$rootScope.$broadcast('KeepaliveResponse', data, status);
45+
function handleResponse(response) {
46+
$rootScope.$broadcast('KeepaliveResponse', response.data, response.status);
4747
}
4848

4949
function ping() {
5050
$rootScope.$broadcast('Keepalive');
5151

5252
if (angular.isObject(options.http)) {
5353
$http(options.http)
54-
.success(handleResponse)
55-
.error(handleResponse);
54+
.then(handleResponse)
55+
.catch(handleResponse);
5656
}
5757
}
5858

angular-idle.map

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

angular-idle.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.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ng-idle",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
44
"homepage": "https://github.com/HackedByChinese/ng-idle",
55
"description": "Responding to idle users in AngularJS",
66
"main": "angular-idle.js",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ng-idle",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
44
"description": "Directives and services for responding to idle users in AngularJS",
55
"keywords": [
66
"angularjs",

src/keepalive/keepalive.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ angular.module('ngIdle.keepalive', [])
3333
ping: null
3434
};
3535

36-
function handleResponse(data, status) {
37-
$rootScope.$broadcast('KeepaliveResponse', data, status);
36+
function handleResponse(response) {
37+
$rootScope.$broadcast('KeepaliveResponse', response.data, response.status);
3838
}
3939

4040
function ping() {
4141
$rootScope.$broadcast('Keepalive');
4242

4343
if (angular.isObject(options.http)) {
4444
$http(options.http)
45-
.success(handleResponse)
46-
.error(handleResponse);
45+
.then(handleResponse)
46+
.catch(handleResponse);
4747
}
4848
}
4949

src/keepalive/keepalive.spec.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ describe('ngIdle', function() {
104104

105105
beforeEach(function() {
106106
Keepalive = create();
107+
spyOn($rootScope, '$broadcast');
107108
});
108109

109110
afterEach(function() {
@@ -116,22 +117,18 @@ describe('ngIdle', function() {
116117
expect(create()._options().interval).toBe(100);
117118
});
118119
it('start() after a new LONGER timeout should NOT broadcast Keepalive when the default timeout expires', function() {
119-
spyOn($rootScope, '$broadcast');
120120
Keepalive.setInterval(100 * 60);
121121
Keepalive.start();
122122
$interval.flush(DEFAULTKEEPALIVEINTERVAL);
123123
expect($rootScope.$broadcast).not.toHaveBeenCalledWith('Keepalive');
124124
});
125125
it('start() after a new LONGER timeout should broadcast Keepalive when the new LONGER expires', function() {
126-
spyOn($rootScope, '$broadcast');
127126
Keepalive.setInterval(100);
128127
Keepalive.start();
129128
$interval.flush(100 * 1000);
130129
expect($rootScope.$broadcast).toHaveBeenCalledWith('Keepalive');
131130
});
132131
it('start() should schedule ping timeout that broadcasts Keepalive event when it expires.', function() {
133-
spyOn($rootScope, '$broadcast');
134-
135132
Keepalive.start();
136133

137134
$interval.flush(DEFAULTKEEPALIVEINTERVAL);
@@ -140,8 +137,6 @@ describe('ngIdle', function() {
140137
});
141138

142139
it('stop() should cancel ping timeout.', function() {
143-
spyOn($rootScope, '$broadcast');
144-
145140
Keepalive.start();
146141
Keepalive.stop();
147142

@@ -151,8 +146,6 @@ describe('ngIdle', function() {
151146
});
152147

153148
it('ping() should immediately broadcast Keepalive event', function() {
154-
spyOn($rootScope, '$broadcast');
155-
156149
Keepalive.ping();
157150

158151
$interval.flush(DEFAULTKEEPALIVEINTERVAL);
@@ -161,8 +154,6 @@ describe('ngIdle', function() {
161154
});
162155

163156
it('should invoke a URL when pinged and broadcast KeepaliveResponse on success.', function() {
164-
spyOn($rootScope, '$broadcast');
165-
166157
Keepalive = create('/path/to/keepalive');
167158

168159
Keepalive.start();
@@ -178,8 +169,6 @@ describe('ngIdle', function() {
178169
});
179170

180171
it('should invoke a URL when pinged and broadcast KeepaliveResponse on error.', function() {
181-
spyOn($rootScope, '$broadcast');
182-
183172
Keepalive = create('/path/to/keepalive');
184173

185174
Keepalive.start();

0 commit comments

Comments
 (0)