e7e4872d7a3dcb9b9a00283b69e4f7cb1e1c8cbd
[vnfsdk/refrepo.git] /
1 /*!
2  * Angular Material Design
3  * https://github.com/angular/material
4  * @license MIT
5  * v1.1.3
6  */
7 (function( window, angular, undefined ){
8 "use strict";
9
10 (function() {
11   'use strict';
12
13   /**
14    * @ngdoc module
15    * @name material.components.fabActions
16    */
17   MdFabActionsDirective['$inject'] = ["$mdUtil"];
18   angular
19     .module('material.components.fabActions', ['material.core'])
20     .directive('mdFabActions', MdFabActionsDirective);
21
22   /**
23    * @ngdoc directive
24    * @name mdFabActions
25    * @module material.components.fabActions
26    *
27    * @restrict E
28    *
29    * @description
30    * The `<md-fab-actions>` directive is used inside of a `<md-fab-speed-dial>` or
31    * `<md-fab-toolbar>` directive to mark an element (or elements) as the actions and setup the
32    * proper event listeners.
33    *
34    * @usage
35    * See the `<md-fab-speed-dial>` or `<md-fab-toolbar>` directives for example usage.
36    */
37   function MdFabActionsDirective($mdUtil) {
38     return {
39       restrict: 'E',
40
41       require: ['^?mdFabSpeedDial', '^?mdFabToolbar'],
42
43       compile: function(element, attributes) {
44         var children = element.children();
45
46         var hasNgRepeat = $mdUtil.prefixer().hasAttribute(children, 'ng-repeat');
47
48         // Support both ng-repeat and static content
49         if (hasNgRepeat) {
50           children.addClass('md-fab-action-item');
51         } else {
52           // Wrap every child in a new div and add a class that we can scale/fling independently
53           children.wrap('<div class="md-fab-action-item">');
54         }
55       }
56     };
57   }
58
59 })();
60
61 })(window, window.angular);