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: README.md
+21-48Lines changed: 21 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,65 +77,39 @@ The callback function to queue.
77
77
Blocking individual elements
78
78
============================
79
79
80
-
Instead of blocking the whole page, it's also possible to block individual elements. Just like the main `blockUI` service, this can be done either manually or automatically. Elements can be made _block ui enabled_ by adding a sibling `block-ui` directive element.
80
+
Instead of blocking the whole page, it's also possible to block individual elements. Just like the main `blockUI` service, this can be done either manually or automatically. Elements can be made _block ui enabled_ by wrapping them in a `block-ui` element.
81
81
82
+
#### Manual blocking
82
83
```
83
-
<div>
84
+
<div block-ui="myBlockUI">
84
85
<p> ... I'm blockable ... </p>
85
-
<div block-ui="myBlockUI"></div>
86
86
</div>
87
87
```
88
88
89
-
#### Automatic blocking
90
-
91
-
Automatic blocking elements can be done by providing the `block-ui` directive a `block-ui-pattern` attribute. This attribute should contain a valid regular expression, which indicates the requests that are associated with the specific element.
89
+
The `block-ui` directive takes an optional value, which can be used to get an instance of the associated `blockUI` service.
92
90
93
91
```
94
-
<div>
95
-
<p> ... I'm blockable ... </p>
96
-
<!-- Initiated the block whenever a request to '/api/quote' is performed -->
var myBlockUI = blockUI.instances.get('myBlockUI');
94
+
95
+
// Start blocking the element.
96
+
myBlockUI.start();
97
+
98
+
$timeout(function() {
99
+
// Stop the block after some async operation.
100
+
myBlockUI.stop();
101
+
}, 1000);
99
102
```
103
+
#### Automatic blocking
100
104
101
-
#### Manual blocking
105
+
Automatic blocking elements can be done by providing the `block-ui` directive a `block-ui-pattern` attribute. This attribute should contain a valid regular expression, which indicates the requests that are associated with the specific element.
102
106
103
-
By providing the `block-ui` directive a name the controller can request the instance via the injected `blockUI` service. All functions exposed by the main `blockUI` service are available on the individual instances.
104
-
105
107
```
106
-
<div>
108
+
<!-- Initiated the UI block whenever a request to '/api/quote' is performed -->
Copy file name to clipboardExpand all lines: dist/README.md
+21-48Lines changed: 21 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,65 +77,39 @@ The callback function to queue.
77
77
Blocking individual elements
78
78
============================
79
79
80
-
Instead of blocking the whole page, it's also possible to block individual elements. Just like the main `blockUI` service, this can be done either manually or automatically. Elements can be made _block ui enabled_ by adding a sibling `block-ui` directive element.
80
+
Instead of blocking the whole page, it's also possible to block individual elements. Just like the main `blockUI` service, this can be done either manually or automatically. Elements can be made _block ui enabled_ by wrapping them in a `block-ui` element.
81
81
82
+
#### Manual blocking
82
83
```
83
-
<div>
84
+
<div block-ui="myBlockUI">
84
85
<p> ... I'm blockable ... </p>
85
-
<div block-ui="myBlockUI"></div>
86
86
</div>
87
87
```
88
88
89
-
#### Automatic blocking
90
-
91
-
Automatic blocking elements can be done by providing the `block-ui` directive a `block-ui-pattern` attribute. This attribute should contain a valid regular expression, which indicates the requests that are associated with the specific element.
89
+
The `block-ui` directive takes an optional value, which can be used to get an instance of the associated `blockUI` service.
92
90
93
91
```
94
-
<div>
95
-
<p> ... I'm blockable ... </p>
96
-
<!-- Initiated the block whenever a request to '/api/quote' is performed -->
var myBlockUI = blockUI.instances.get('myBlockUI');
94
+
95
+
// Start blocking the element.
96
+
myBlockUI.start();
97
+
98
+
$timeout(function() {
99
+
// Stop the block after some async operation.
100
+
myBlockUI.stop();
101
+
}, 1000);
99
102
```
103
+
#### Automatic blocking
100
104
101
-
#### Manual blocking
105
+
Automatic blocking elements can be done by providing the `block-ui` directive a `block-ui-pattern` attribute. This attribute should contain a valid regular expression, which indicates the requests that are associated with the specific element.
102
106
103
-
By providing the `block-ui` directive a name the controller can request the instance via the injected `blockUI` service. All functions exposed by the main `blockUI` service are available on the individual instances.
104
-
105
107
```
106
-
<div>
108
+
<!-- Initiated the UI block whenever a request to '/api/quote' is performed -->
0 commit comments