Skip to content

Commit b6b4546

Browse files
author
Null McNull
committed
Change message based on http method
1 parent cf80656 commit b6b4546

14 files changed

+122
-14
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,36 @@ Allows you to specify a filter function to exclude certain ajax requests from bl
178178
}
179179
};
180180

181+
If the filter function returns a _string_ it will be passed as the `message` argument to the `start` method of the service.
182+
183+
// Change the displayed message based on the http verbs being used.
184+
blockUIConfig.requestFilter = function(config) {
185+
186+
var message;
187+
188+
switch(config.method) {
189+
case 'GET':
190+
message = 'Getting ...';
191+
break;
192+
193+
case 'POST':
194+
message = 'Posting ...';
195+
break;
196+
197+
case 'DELETE':
198+
message = 'Deleting ...';
199+
break;
200+
201+
case 'PUT':
202+
message = 'Putting ...';
203+
break;
204+
};
205+
206+
return message;
207+
208+
};
209+
210+
181211
#### autoInjectBodyBlock
182212
When the module is started it will inject the _main block element_ by adding the `block-ui` directive to the `body` element.
183213

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-block-ui",
33
"description": "An AngularJS module that allows you to block user interaction on AJAX requests.",
4-
"version": "0.1.0-beta.1",
4+
"version": "0.1.0-beta.2",
55
"keywords": [
66
"angular",
77
"angularjs",

dist/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,36 @@ Allows you to specify a filter function to exclude certain ajax requests from bl
178178
}
179179
};
180180

181+
If the filter function returns a _string_ it will be passed as the `message` argument to the `start` method of the service.
182+
183+
// Change the displayed message based on the http verbs being used.
184+
blockUIConfig.requestFilter = function(config) {
185+
186+
var message;
187+
188+
switch(config.method) {
189+
case 'GET':
190+
message = 'Getting ...';
191+
break;
192+
193+
case 'POST':
194+
message = 'Posting ...';
195+
break;
196+
197+
case 'DELETE':
198+
message = 'Deleting ...';
199+
break;
200+
201+
case 'PUT':
202+
message = 'Putting ...';
203+
break;
204+
};
205+
206+
return message;
207+
208+
};
209+
210+
181211
#### autoInjectBodyBlock
182212
When the module is started it will inject the _main block element_ by adding the `block-ui` directive to the `body` element.
183213

dist/angular-block-ui.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.

dist/angular-block-ui.css.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.

dist/angular-block-ui.js

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

dist/angular-block-ui.js.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.

dist/angular-block-ui.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.

0 commit comments

Comments
 (0)