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
Creates a new notification popup from given template.
94
94
The template can either be a string or a jQuery object representing a DOM node that is *not* in the current DOM.
95
95
96
96
Creating a notification popup
97
+
98
+
```js
97
99
// note that you can even provide an HTML Element node with
98
100
// custom event handlers directly here instead of HTML text.
99
101
let notification1 =NotificationUI.createFromTemplate(
100
-
```js
101
102
"<div>Click me to locate the file in file tree</div>", "showInfileTree",{
102
103
allowedPlacements: ['top', 'bottom'],
103
104
dismissOnClick:false,
@@ -110,9 +111,10 @@ let notification1 = NotificationUI.createFromTemplate(
110
111
111
112
| Param | Type | Description |
112
113
| --- | --- | --- |
114
+
| title | <code>string</code> | The title for the notification. |
113
115
| template | <code>string</code> \| <code>Element</code> | A string template or HTML Element to use as the dialog HTML. |
114
116
|[elementID]| <code>String</code> | optional id string if provided will show the notification pointing to the element. If no element is specified, it will be managed as a generic notification. |
115
-
|[options]| <code>Object</code> | optional, supported * options are: * `allowedPlacements` - Optional String array with values restricting where the notification will be shown. Values can be a mix of `['top', 'bottom', 'left', 'right']` * `autoCloseTimeS` - Time in seconds after which the notification should be auto closed. Default is never. * `dismissOnClick` - when clicked, the notification is closed. Default is true(dismiss). |
117
+
|[options]| <code>Object</code> | optional, supported * options are: * `allowedPlacements` - Optional String array with values restricting where the notification will be shown. Values can be a mix of `['top', 'bottom', 'left', 'right']` * `autoCloseTimeS` - Time in seconds after which the notification should be auto closed. Default is never. * `dismissOnClick` - when clicked, the notification is closed. Default is true(dismiss). * `toastStyle` - To style the toast notification for error, warning, info etc. Can be one of `NotificationUI.NOTIFICATION_STYLES_CSS_CLASS.*` or your own css class name. |
@@ -121,10 +123,11 @@ Creates a new toast notification popup from given title and html message.
121
123
The message can either be a string or a jQuery object representing a DOM node that is *not* in the current DOM.
122
124
123
125
Creating a toast notification popup
126
+
127
+
```js
124
128
// note that you can even provide an HTML Element node with
125
129
// custom event handlers directly here instead of HTML text.
126
130
let notification1 =NotificationUI.createToastFromTemplate( "Title here",
127
-
```js
128
131
"<div>Click me to locate the file in file tree</div>", {
129
132
dismissOnClick:false,
130
133
autoCloseTimeS:300// auto close the popup after 5 minutes
@@ -138,5 +141,5 @@ let notification1 = NotificationUI.createToastFromTemplate( "Title here",
138
141
| --- | --- | --- |
139
142
| title | <code>string</code> | The title for the notification. |
140
143
| template | <code>string</code> \| <code>Element</code> | A string template or HTML Element to use as the dialog HTML. |
141
-
|[options]| <code>Object</code> | optional, supported * options are: * `autoCloseTimeS` - Time in seconds after which the notification should be auto closed. Default is never. * `dismissOnClick` - when clicked, the notification is closed. Default is true(dismiss). * `toastStyle` - To style the toast notification for error, warning, info etc. Can be one of `NotificationUI.NOTIFICATION_STYLES_CSS_CLASS.*` or your own css class name. |
144
+
|[options]| <code>Object</code> | optional, supported * options are: * `autoCloseTimeS` - Time in seconds after which the notification should be auto closed. Default is never. * `dismissOnClick` - when clicked, the notification is closed. Default is true(dismiss). * `toastStyle` - To style the toast notification for error, warning, info etc. Can be one of `NotificationUI.NOTIFICATION_STYLES_CSS_CLASS.*` or your own css class name. * `instantOpen` - To instantly open the popup without any open animation delays |
0 commit comments