|
| 1 | +/** |
| 2 | + * @ngdoc directive |
| 3 | + * @name patternfly.navigation.component:pfApplicationLauncher |
| 4 | + * @restrict E |
| 5 | + * |
| 6 | + * @description |
| 7 | + * Component for rendering application launcher dropdown. |
| 8 | + * |
| 9 | + * @param {string=} label Use a custom label for the launcher, default: Application Launcher |
| 10 | + * @param {boolean=} isDisabled Disable the application launcher button, default: false |
| 11 | + * @param {boolean=} isList Display items as a list instead of a grid, default: false |
| 12 | + * @param {boolean=} hiddenIcons Flag to not show icons on the launcher, default: false |
| 13 | + * @param {array} items List of navigation items |
| 14 | + * <ul style='list-style-type: none'> |
| 15 | + * <li>.title - (string) Name of item to be displayed on the menu |
| 16 | + * <li>.iconClass - (string) Classes for icon to be shown on the menu (ex. "fa fa-dashboard") |
| 17 | + * <li>.href - (string) href link to navigate to on click |
| 18 | + * <li>.tooltip - (string) Tooltip to display for the badge |
| 19 | + * </ul> |
| 20 | + * @example |
| 21 | + <example module="patternfly.navigation"> |
| 22 | + <file name="index.html"> |
| 23 | + <div ng-controller="applicationLauncherController" class="row"> |
| 24 | + <div class="col-xs-12 pre-demo-text"> |
| 25 | + <label>Click the launcher indicator to show the Application Launcher Dropdown:</label> |
| 26 | + </div> |
| 27 | + <nav class="navbar navbar-pf navbar-collapse"> |
| 28 | + <ul class="nav navbar-left"> |
| 29 | + <li> |
| 30 | + <pf-application-launcher items="navigationItems" label="{{label}}" is-disabled="isDisabled" is-list="isList" hidden-icons="hiddenIcons"></pf-application-launcher> |
| 31 | + </li> |
| 32 | + </ul> |
| 33 | + </nav> |
| 34 | + </div> |
| 35 | + </file> |
| 36 | + <file name="script.js"> |
| 37 | + angular.module('patternfly.navigation').controller('applicationLauncherController', ['$scope', |
| 38 | + function ($scope) { |
| 39 | + $scope.navigationItems = [ |
| 40 | + { |
| 41 | + title: "Recteque", |
| 42 | + href: "#/ipsum/intellegam/recteque", |
| 43 | + tooltip: "Launch the Function User Interface", |
| 44 | + iconClass: "pficon-storage-domain" |
| 45 | + }, |
| 46 | + { |
| 47 | + title: "Suavitate", |
| 48 | + href: "#/ipsum/intellegam/suavitate", |
| 49 | + tooltip: "Launch the Function User Interface", |
| 50 | + iconClass: "pficon-build" |
| 51 | + }, |
| 52 | + { |
| 53 | + title: "Lorem", |
| 54 | + href: "#/ipsum/intellegam/lorem", |
| 55 | + tooltip: "Launch the Function User Interface", |
| 56 | + iconClass: "pficon-domain" |
| 57 | + }, |
| 58 | + { |
| 59 | + title: "Home", |
| 60 | + href: "#/ipsum/intellegam/home", |
| 61 | + tooltip: "Launch the Function User Interface", |
| 62 | + iconClass: "pficon-home" |
| 63 | + } |
| 64 | + ]; |
| 65 | +
|
| 66 | + $scope.label = 'Application Launcher'; |
| 67 | + $scope.isDisabled = false; |
| 68 | + $scope.isList = false; |
| 69 | + $scope.hiddenIcons = false; |
| 70 | + }]); |
| 71 | + </file> |
| 72 | + </example> |
| 73 | + */ |
| 74 | +angular.module('patternfly.navigation').component('pfApplicationLauncher', { |
| 75 | + bindings: { |
| 76 | + items: '<', |
| 77 | + label: '@?', |
| 78 | + isDisabled: '<?', |
| 79 | + isList: '<?', |
| 80 | + hiddenIcons: '<?' |
| 81 | + }, |
| 82 | + templateUrl: 'navigation/application-launcher.html', |
| 83 | + controller: function ($scope) { |
| 84 | + 'use strict'; |
| 85 | + var ctrl = this; |
| 86 | + |
| 87 | + ctrl.$id = $scope.$id; |
| 88 | + } |
| 89 | +}); |
| 90 | + |
0 commit comments