@@ -6,7 +6,7 @@ AngularJS-Toaster
6
6
[ ![ Build Status] ( https://travis-ci.org/jirikavi/AngularJS-Toaster.svg )] ( https://travis-ci.org/jirikavi/AngularJS-Toaster )
7
7
[ ![ Coverage Status] ( https://coveralls.io/repos/jirikavi/AngularJS-Toaster/badge.svg?branch=master&service=github&busting=3 )] ( https://coveralls.io/github/jirikavi/AngularJS-Toaster?branch=master )
8
8
9
- ### Current Version 1.2.0
9
+ ### Current Version 1.2.1
10
10
11
11
## Angular Compatibility
12
12
AngularJS-Toaster requires AngularJS v1.2.6 or higher and specifically targets AngularJS, not Angular 2, although it could be used via ngUpgrade.
@@ -64,6 +64,39 @@ angular.module('main', ['toaster', 'ngAnimate'])
64
64
</div >
65
65
```
66
66
67
+ ### Timeout
68
+ By default, toasts have a timeout setting of 5000, meaning that they are removed after 5000
69
+ milliseconds.
70
+
71
+ If the timeout is set to anything other than a number greater than 0, the toast will be considered
72
+ "sticky" and will not automatically dismiss.
73
+
74
+ The timeout can be configured at three different levels:
75
+
76
+ * Globally in the config for all toast types:
77
+ ``` html
78
+ <toaster-container toaster-options =" {'time-out': 1000}" ></toaster-container >
79
+ ```
80
+
81
+ * Per info-class type:
82
+ By passing the time-out configuration as an object instead of a number, you can specify the global behavior an info-class type should have.
83
+ ``` html
84
+ <toaster-container toaster-options ="
85
+ {'time-out':{ 'toast-warning': 10, 'toast-error': 0 } }" >
86
+ </toaster-container >
87
+ ```
88
+ If a type is not defined and specified, a timeout will not be applied, making the toast "sticky".
89
+
90
+ * Per toast constructed via toaster.pop('success', "title", "text"):
91
+ ``` html
92
+ toaster.pop({
93
+ type: 'error',
94
+ title: 'Title text',
95
+ body: 'Body text',
96
+ timeout: 3000
97
+ });
98
+ ```
99
+
67
100
### Close Button
68
101
69
102
The Close Button's visibility can be configured at three different levels:
@@ -260,6 +293,35 @@ vm.popContainerTwo = function () {
260
293
and it is documented in these [ tests] ( test/toasterContainerSpec.js#L430 ) .
261
294
262
295
296
+ ### Limit
297
+ Limit is defaulted to 0, meaning that there is no maximum number of toasts that are defined
298
+ before the toast container begins removing toasts when a new toast is added.
299
+
300
+ To change this behavior, pass a "limit" option to the toast-container configuration:
301
+
302
+ ``` html
303
+ <toaster-container toaster-options =" {'limit':5}" ></toaster-container >
304
+ ```
305
+
306
+ ### Dismiss on tap
307
+ By default, the ` tap-to-dismiss ` option is set to true, meaning that if a toast is clicked anywhere
308
+ on the toast body, the toast will be dismissed. This behavior can be overriden in the toast-container
309
+ configuration so that if set to false, the toast will only be dismissed if the close button is defined
310
+ and clicked:
311
+
312
+ ``` html
313
+ <toaster-container toaster-options =" {'tap-to-dismiss':false}" ></toaster-container >
314
+ ```
315
+
316
+ ### Newest Toasts on Top
317
+ The ` newest-on-top ` option is defaulted to true, adding new toasts on top of other existing toasts.
318
+ If changed to false via the toaster-container configuration, toasts will be added to the bottom of
319
+ other existing toasts.
320
+
321
+ ``` html
322
+ <toaster-container toaster-options =" {'newest-on-top':false}" ></toaster-container >
323
+ ```
324
+
263
325
### Other Options
264
326
265
327
``` html
0 commit comments