|
58 | 58 | * @param {function (action, item))} updateMenuActionForItemFn function(action, item) Used to update a menu action based on the current item |
59 | 59 | * @param {object} customScope Object containing any variables/functions used by the transcluded html, access via $ctrl.customScope.<xxx> |
60 | 60 | * @param {object} emptyStateConfig Optional configuration settings for the empty state component. See the {@link patternfly.views.component:pfEmptyState Empty State} component |
| 61 | + * @param {array} emptyStateActionButtons Optional buttons to display under the icon, title, and informational paragraph in the empty state component. See the {@link patternfly.views.component:pfEmptyState Empty State} component |
61 | 62 | * @example |
62 | 63 | <example module="patternfly.views" deps="patternfly.utils"> |
63 | 64 | <file name="index.html"> |
|
93 | 94 | menu-actions="menuActions" |
94 | 95 | update-menu-action-for-item-fn="updateMenuActionForItemFn" |
95 | 96 | menu-class-for-item-fn="getMenuClass" |
96 | | - hide-menu-for-item-fn="hideMenuActions"> |
| 97 | + hide-menu-for-item-fn="hideMenuActions" |
| 98 | + empty-state-action-buttons="emptyStateActionButtons"> |
97 | 99 | <div class="list-view-pf-description"> |
98 | 100 | <div class="list-group-item-heading"> |
99 | 101 | {{item.name}} |
|
307 | 309 | onDblClick: handleDblClick |
308 | 310 | }; |
309 | 311 |
|
| 312 | + var performEmptyStateAction = function (action) { |
| 313 | + $scope.eventText = action.name + "\r\n" + $scope.eventText; |
| 314 | + }; |
| 315 | +
|
310 | 316 | $scope.emptyStateConfig = { |
311 | 317 | icon: 'pficon-warning-triangle-o', |
312 | 318 | title: 'No Items Available', |
|
318 | 324 | } |
319 | 325 | }; |
320 | 326 |
|
| 327 | + $scope.emptyStateActionButtons = [ |
| 328 | + { |
| 329 | + name: 'Main Action', |
| 330 | + title: 'Perform an action', |
| 331 | + actionFn: performEmptyStateAction, |
| 332 | + type: 'main' |
| 333 | + }, |
| 334 | + { |
| 335 | + name: 'Secondary Action 1', |
| 336 | + title: 'Perform an action', |
| 337 | + actionFn: performEmptyStateAction |
| 338 | + }, |
| 339 | + { |
| 340 | + name: 'Secondary Action 2', |
| 341 | + title: 'Perform an action', |
| 342 | + actionFn: performEmptyStateAction |
| 343 | + }, |
| 344 | + { |
| 345 | + name: 'Secondary Action 3', |
| 346 | + title: 'Perform an action', |
| 347 | + actionFn: performEmptyStateAction |
| 348 | + } |
| 349 | + ]; |
| 350 | +
|
321 | 351 | $scope.items = [ |
322 | 352 | { |
323 | 353 | name: "Fred Flintstone", |
|
534 | 564 | </div> |
535 | 565 | </div> |
536 | 566 | </file> |
537 | | - <file name="counpund.js"> |
| 567 | + <file name="compound.js"> |
538 | 568 | angular.module('patternfly.views').controller('CompoundExanspansionCtrl', ['$scope', '$templateCache', |
539 | 569 | function ($scope, $templateCache) { |
540 | 570 | $scope.eventText = ''; |
|
0 commit comments