Skip to content

Commit 4362a46

Browse files
Only stop the block element on the config
1 parent 4d845ca commit 4362a46

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

src/angular-block-ui/interceptor.js

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ angular.module('blockUI').factory('blockUIHttpInterceptor', function($q, $inject
66
blockUI = blockUI || $injector.get('blockUI');
77
}
88

9-
function error(rejection) {
10-
if (blockUIConfig.autoBlock) {
9+
function stopBlockUI(config) {
10+
if (blockUIConfig.autoBlock && !config.$_noBlock && config.$_blocks) {
1111
injectBlockUI();
12-
blockUI.instances.stop();
12+
config.$_blocks.stop();
1313
}
14+
}
1415

16+
function error(rejection) {
17+
stopBlockUI(rejection.config);
1518
return $q.reject(rejection);
1619
}
1720

@@ -39,16 +42,7 @@ angular.module('blockUI').factory('blockUIHttpInterceptor', function($q, $inject
3942
requestError: error,
4043

4144
response: function(response) {
42-
43-
// Check if the response is tagged to ignore
44-
45-
var cfg = response.config;
46-
47-
if (blockUIConfig.autoBlock && !cfg.$_noBlock && cfg.$_blocks) {
48-
injectBlockUI();
49-
cfg.$_blocks.stop();
50-
}
51-
45+
stopBlockUI(response.config)
5246
return response;
5347
},
5448

0 commit comments

Comments
 (0)