|
7 | 7 | * @param {Array} notifications The list of current notifications to display. Each notification should have the following (see pfToastNotification): |
8 | 8 | * <ul style='list-style-type: none'> |
9 | 9 | * <li>.type - (String) The type of the notification message. Allowed value is one of these: 'success','info','danger', 'warning' |
10 | | - * <li>.header - (String) The header to display for the notification, accepts HTML content. (optional) |
11 | | - * <li>.message - (String) The main text message of the notification. Accepts HTML content. |
| 10 | + * <li>.header - (String) The header to display for the notification, accepts HTML content when allowed. (optional) |
| 11 | + * <li>.message - (String) The main text message of the notification. Accepts HTML content when allowed. |
12 | 12 | * <li>.actionTitle Text to show for the primary action, optional. |
13 | 13 | * <li>.actionCallback (function(this notification)) Function to invoke when primary action is selected, optional |
14 | 14 | * <li>.menuActions Optional list of actions to place in the kebab menu:<br/> |
|
21 | 21 | * <li>.isPersistent Flag to show close button for the notification even if showClose is false. |
22 | 22 | * </ul> |
23 | 23 | * @param {Boolean} showClose Flag to show the close button on all notifications (not shown if the notification has menu actions) |
| 24 | + * @param {Boolean} htmlContent Flag to allow HTML content within the header and message options. |
24 | 25 | * @param {function} closeCallback (function(data)) Function to invoke when closes a toast notification |
25 | 26 | * @param {function} updateViewing (function(boolean, data)) Function to invoke when user is viewing/not-viewing (hovering on) a toast notification |
26 | 27 | * |
|
32 | 33 |
|
33 | 34 | <file name="index.html"> |
34 | 35 | <div ng-controller="ToastNotificationListDemoCtrl" > |
35 | | - <pf-toast-notification-list notifications="notifications" show-close="showClose" close-callback="handleClose" update-viewing="updateViewing"></pf-toast-notification-list> |
| 36 | + <pf-toast-notification-list notifications="notifications" show-close="showClose" html-content="htmlContent" close-callback="handleClose" update-viewing="updateViewing"></pf-toast-notification-list> |
36 | 37 | <div class="row example-container"> |
37 | 38 | <div class="col-md-12"> |
38 | 39 | <form class="form-horizontal"> |
|
84 | 85 | <input type="checkbox" ng-model="persistent"/> |
85 | 86 | </div> |
86 | 87 | <label class="col-sm-2 control-label" for="type">Show Menu:</label> |
87 | | - <div class="col-sm-2"> |
| 88 | + <div class="col-sm-1"> |
88 | 89 | <input type="checkbox" ng-model="showMenu"/> |
89 | 90 | </div> |
| 91 | + <label class="col-sm-2 control-label" for="type">Allow HTML:</label> |
| 92 | + <div class="col-sm-1"> |
| 93 | + <input type="checkbox" ng-model="htmlContent"/> |
| 94 | + </div> |
90 | 95 | </div> |
91 | 96 | <div class="form-group"> |
92 | 97 | <div class="col-sm-12"> |
|
120 | 125 | $scope.header = 'Default header.'; |
121 | 126 | $scope.message = 'Default <strong>notification</strong> message.'; |
122 | 127 | $scope.showClose = false; |
| 128 | + $scope.htmlContent = false; |
123 | 129 | $scope.persistent = false; |
124 | 130 |
|
125 | 131 | $scope.primaryAction = ''; |
@@ -205,6 +211,7 @@ angular.module('patternfly.notification').component('pfToastNotificationList', { |
205 | 211 | bindings: { |
206 | 212 | notifications: '=', |
207 | 213 | showClose: '=?', |
| 214 | + htmlContent: '<?', |
208 | 215 | closeCallback: '=?', |
209 | 216 | updateViewing: '=?' |
210 | 217 | }, |
|
0 commit comments