Skip to content

Commit 59abefd

Browse files
author
Null McNull
committed
README update and delay fix
1 parent f522529 commit 59abefd

File tree

7 files changed

+39
-42
lines changed

7 files changed

+39
-42
lines changed

README.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Besides AngularJS (~1.2.4), none.
99
Live demos can be found on [Plunker](http://plnkr.co/edit/XWRfHX?p=preview) or by executing the website included in the [GitHub project](https://github.com/McNull/angular-block-ui) .
1010

1111
#### Installation
12-
Either copy the contents of the `package` directory of the [Github](https://github.com/McNull/angular-block-ui) project or install with _bower_ from the command line (**recommended**):
12+
Either copy the contents of the `dist` directory of the [Github](https://github.com/McNull/angular-block-ui) project or install with _bower_ from the command line (**recommended**):
1313

1414
bower install angular-block-ui
1515

@@ -114,70 +114,69 @@ Automatic blocking elements can be done by providing the `block-ui` directive a
114114
BlockUI module configuration
115115
============================
116116

117-
The configuration of the BlockUI module can be modified via the **blockUIConfigProvider** during the config phase of your Angular application:
117+
The configuration of the BlockUI module can be modified via the `blockUIConfig` during the config phase of your Angular application:
118118

119-
angular.module('myApp').config(function(blockUIConfigProvider) {
119+
angular.module('myApp').config(function(blockUIConfig) {
120120
121121
// Change the default overlay message
122-
blockUIConfigProvider.message('Please stop clicking!');
122+
blockUIConfig.message = 'Please stop clicking!';
123123
124124
// Change the default delay to 100ms before the blocking is visible
125-
blockUIConfigProvider.delay(100);
125+
blockUIConfig.delay = 100;
126126
127127
});
128128

129-
### Methods
129+
### Properties
130130

131131
#### message
132132
Changes the default message to be used when no message has been provided to the *start* method of the service. Default value is *'Loading ...'*.
133133

134134
// Change the default overlay message
135-
blockUIConfigProvider.message('Please wait');
135+
blockUIConfig.message = 'Please wait';
136136

137137
#### delay
138138
Specifies the amount in milliseconds before the block is visible to the user. By delaying a visible block your application will appear more responsive. The default value is *250*.
139139

140140
// Change the default delay to 100ms before the blocking is visible ...
141-
blockUIConfigProvider.delay(100);
141+
blockUIConfig.delay = 100;
142142

143143
// ... or completely remove the delay
144-
blockUIConfigProvider.delay(1);
144+
blockUIConfig.delay = 0;
145145

146146
#### template
147147
Specifies a custom template to use as the overlay.
148148

149149
// Provide a custom template to use
150-
blockUIConfigProvider.template('<pre><code>{{ state | json }}</code></pre>');
150+
blockUIConfig.template = '<pre><code>{{ state | json }}</code></pre>';
151151

152152
#### templateUrl
153153
Specifies a url to retrieve the template from. *The current release only works with pre-cached templates, which means that this url should be known in the $templateCache service of Angular. If you're using the grunt with html2js or angular-templates, which I highly recommend, you're already set.*
154154

155155
// Provide the custom template via a url
156-
blockUIConfigProvider.templateUrl('my-templates/block-ui-overlay.html');
156+
blockUIConfig.templateUrl = 'my-templates/block-ui-overlay.html';
157157

158158
#### autoBlock
159159
By default the BlockUI module will start a block whenever the Angular *$http* service has an pending request. If you don't want this behaviour and want to do all the blocking manually you can change this value to *false*.
160160

161161
// Disable automatically blocking of the user interface
162-
blockUIConfigProvider.autoBlock(false);
162+
blockUIConfig.autoBlock = false;
163163

164164
#### resetOnException
165165
By default the BlockUI module will reset the block count and hide the overlay whenever an exception has occurred. You can set this value to *false* if you don't want this behaviour.
166166

167167
// Disable clearing block whenever an exception has occurred
168-
blockUIConfigProvider.resetOnException(false);
168+
blockUIConfig.resetOnException = false;
169169

170170
#### requestFilter
171171
Allows you to specify a filter function to exclude certain ajax requests from blocking the user interface. The function is passed the [Angular request config object](http://docs.angularjs.org/api/ng/service/$http). The blockUI service will ignore requests when the function returns `false`.
172172

173173
// Tell the blockUI service to ignore certain requests
174-
blockUIConfigProvider.requestFilter(function(config) {
175-
176-
// If the request starts with '/api/quote' ...
174+
blockUIConfig.requestFilter = function(config) {
175+
// If the request starts with '/api/quote' ...
177176
if(config.url.match(/^\/api\/quote($|\/).*/)) {
178177
return false; // ... don't block it.
179178
}
180-
});
179+
};
181180

182181
#### autoInjectBodyBlock
183182
When the module is started it will inject the _main block element_ by adding the `block-ui` directive to the `body` element.
@@ -187,6 +186,11 @@ When the module is started it will inject the _main block element_ by adding the
187186

188187
This behaviour can be disabled if there no need for any _fullscreen_ blocking or if there's more control required.
189188

190-
blockUIConfigProvider.autoInjectBodyBlock(false); // Disable auto body block
189+
blockUIConfig.autoInjectBodyBlock = false; // Disable auto body block
191190

191+
#### cssClass
192+
A string containing the default css classes, separated by spaces, that should be applied to each block-ui element. The default value is `'block-ui block-ui-anim-fade'`.
193+
194+
If this needs to be overridden for a certain element; set the desired classes on the element including the `block-ui` class. This way the directive will not apply the configured classes to the element.
192195

196+
blockUIConfig.cssClass = 'block-ui my-custom-class'; // Apply these classes to al block-ui elements

dist/angular-block-ui.css

Lines changed: 2 additions & 4 deletions
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.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.

src/angular-block-ui/block-ui-animations.css

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11

22
/* - - - - - - 8-< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
33

4-
.block-ui-anim-fade .block-ui-container {
5-
transition: height 0s linear 250ms, opacity 250ms ease 0s;
4+
.block-ui-anim-fade > .block-ui-container {
5+
transition: height 0s linear 200ms, opacity 200ms ease 0s;
66
}
77

8-
.block-ui-anim-fade.block-ui-visible > .block-ui-container {
9-
10-
/*transition: height 0s linear 0s, opacity 250ms ease 0s;*/
11-
8+
.block-ui-anim-fade.block-ui-active > .block-ui-container {
129
/*this resets the initial delay of the height */
1310
/*and sizes the block to full height at once at the start of the block. */
1411
transition-delay: 0s;

src/app/app.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,9 @@ angular.module('myApp', [
4343
delayConfig.timeout.max = 2000;
4444
}
4545

46-
// blockUIConfigProvider.delay(1000);
46+
// blockUIConfig.template = '<pre><code>{{ state | json }}</code></pre>';
4747

48-
// blockUIConfigProvider.template('<pre><code>{{ state | json }}</code></pre>');
49-
50-
// blockUIConfigProvider.autoInjectBodyBlock(false);
51-
52-
// blockUIConfigProvider.requestFilter(function(config) {
53-
// if(config.url.match(/^\/api\/quote($|\/).*/)) {
54-
// return false;
55-
// }
56-
// });
57-
//blockUIConfigProvider.message('Fun with config');
58-
// blockUIConfigProvider.autoBlock(false);
48+
// blockUIConfig.delay = 200;
5949

6050
}).controller('MainController', function($scope, blockUI) {
6151
// blockUI.start();

src/app/examples/examples.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@
5050
overflow: hidden;
5151
}
5252

53+
/*.example-container.block-ui-active {*/
54+
/*background-color: yellow;*/
55+
/*}*/
56+
57+
/*.example-container.block-ui-visible {*/
58+
/*background-color: green;*/
59+
/*}*/
60+
5361
/*.login-form-block .block-ui-overlay.block-ui-visible {
5462
background-color: yellow;
5563
}*/

0 commit comments

Comments
 (0)