12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- /*!
- * Angular Material Design
- * https://github.com/angular/material
- * @license MIT
- * v0.11.4
- */
- (function( window, angular, undefined ){
- "use strict";
- (function() {
- 'use strict';
- /**
- * @ngdoc module
- * @name material.components.fabActions
- */
- angular
- .module('material.components.fabActions', ['material.core'])
- .directive('mdFabActions', MdFabActionsDirective);
- /**
- * @ngdoc directive
- * @name mdFabActions
- * @module material.components.fabActions
- *
- * @restrict E
- *
- * @description
- * The `<md-fab-actions>` directive is used inside of a `<md-fab-speed-dial>` or
- * `<md-fab-toolbar>` directive to mark an element (or elements) as the actions and setup the
- * proper event listeners.
- *
- * @usage
- * See the `<md-fab-speed-dial>` or `<md-fab-toolbar>` directives for example usage.
- */
- function MdFabActionsDirective() {
- return {
- restrict: 'E',
- require: ['^?mdFabSpeedDial', '^?mdFabToolbar'],
- compile: function(element, attributes) {
- var children = element.children();
- var hasNgRepeat = false;
- angular.forEach(['', 'data-', 'x-'], function(prefix) {
- hasNgRepeat = hasNgRepeat || (children.attr(prefix + 'ng-repeat') ? true : false);
- });
- // Support both ng-repeat and static content
- if (hasNgRepeat) {
- children.addClass('md-fab-action-item');
- } else {
- // Wrap every child in a new div and add a class that we can scale/fling independently
- children.wrap('<div class="md-fab-action-item">');
- }
- }
- }
- }
- })();
- })(window, window.angular);
|