You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dist/README.md
+22-18Lines changed: 22 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Besides AngularJS (~1.2.4), none.
9
9
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) .
10
10
11
11
#### 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**):
13
13
14
14
bower install angular-block-ui
15
15
@@ -114,70 +114,69 @@ Automatic blocking elements can be done by providing the `block-ui` directive a
114
114
BlockUI module configuration
115
115
============================
116
116
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:
// Change the default delay to 100ms before the blocking is visible
125
-
blockUIConfigProvider.delay(100);
125
+
blockUIConfig.delay = 100;
126
126
127
127
});
128
128
129
-
### Methods
129
+
### Properties
130
130
131
131
#### message
132
132
Changes the default message to be used when no message has been provided to the *start* method of the service. Default value is *'Loading ...'*.
133
133
134
134
// Change the default overlay message
135
-
blockUIConfigProvider.message('Please wait');
135
+
blockUIConfig.message = 'Please wait';
136
136
137
137
#### delay
138
138
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*.
139
139
140
140
// Change the default delay to 100ms before the blocking is visible ...
141
-
blockUIConfigProvider.delay(100);
141
+
blockUIConfig.delay = 100;
142
142
143
143
// ... or completely remove the delay
144
-
blockUIConfigProvider.delay(1);
144
+
blockUIConfig.delay = 0;
145
145
146
146
#### template
147
147
Specifies a custom template to use as the overlay.
148
148
149
149
// Provide a custom template to use
150
-
blockUIConfigProvider.template('<pre><code>{{ state | json }}</code></pre>');
150
+
blockUIConfig.template = '<pre><code>{{ state | json }}</code></pre>';
151
151
152
152
#### templateUrl
153
153
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.*
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*.
160
160
161
161
// Disable automatically blocking of the user interface
162
-
blockUIConfigProvider.autoBlock(false);
162
+
blockUIConfig.autoBlock = false;
163
163
164
164
#### resetOnException
165
165
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.
166
166
167
167
// Disable clearing block whenever an exception has occurred
168
-
blockUIConfigProvider.resetOnException(false);
168
+
blockUIConfig.resetOnException = false;
169
169
170
170
#### requestFilter
171
171
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`.
172
172
173
173
// Tell the blockUI service to ignore certain requests
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
187
186
188
187
This behaviour can be disabled if there no need for any _fullscreen_ blocking or if there's more control required.
189
188
190
-
blockUIConfigProvider.autoInjectBodyBlock(false); // Disable auto body block
189
+
blockUIConfig.autoInjectBodyBlock = false; // Disable auto body block
191
190
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.
192
195
196
+
blockUIConfig.cssClass = 'block-ui my-custom-class'; // Apply these classes to al block-ui elements
0 commit comments