Sha256: b7d9f9ee212c984a57ac18fc330872b925dad9e72a51d910e64062f4c22581c6
Contents?: true
Size: 1.62 KB
Versions: 6
Compression:
Stored size: 1.62 KB
Contents
/*! * Angular Material Design * https://github.com/angular/material * @license MIT * v0.10.0 */ (function( window, angular, undefined ){ "use strict"; (function() { 'use strict'; angular .module('material.components.fabActions', ['material.core']) .directive('mdFabActions', MdFabActionsDirective); /** * @ngdoc directive * @name mdFabActions * @module material.components.fabSpeedDial * * @restrict E * * @description * The `<md-fab-actions>` directive is used inside of a `<md-fab-speed-dial>` or * `<md-fab-toolbar>` directive to mark the 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'], link: function(scope, element, attributes, controllers) { // Grab whichever parent controller is used var controller = controllers[0] || controllers[1]; // Make the children open/close their parent directive if (controller) { angular.forEach(element.children(), function(child) { angular.element(child).on('focus', controller.open); angular.element(child).on('blur', controller.close); }); } // After setting up the listeners, wrap every child in a new div and add a class that we can // scale/fling independently element.children().wrap('<div class="md-fab-action-item">'); } } } })(); })(window, window.angular);
Version data entries
6 entries across 6 versions & 1 rubygems