UNPKG

angular-material-npfixed

Version:

The Angular Material project is an implementation of Material Design in Angular.js. This project provides a set of reusable, well-tested, and accessible Material Design UI components. Angular Material is supported internally at Google by the Angular.js, M

53 lines (46 loc) 1.6 kB
(function() { 'use strict'; angular.module('fabSpeedDialDemoMoreOptions', ['ngMaterial']) .controller('DemoCtrl', function($scope, $mdDialog, $timeout) { var self = this; self.hidden = false; self.isOpen = false; self.hover = false; // On opening, add a delayed property which shows tooltips after the speed dial has opened // so that they have the proper position; if closing, immediately hide the tooltips $scope.$watch('demo.isOpen', function(isOpen) { if (isOpen) { $timeout(function() { $scope.tooltipVisible = self.isOpen; }, 600); } else { $scope.tooltipVisible = self.isOpen; } }); self.items = [ { name: "Twitter", icon: "img/icons/twitter.svg", direction: "bottom" }, { name: "Facebook", icon: "img/icons/facebook.svg", direction: "top" }, { name: "Google Hangout", icon: "img/icons/hangout.svg", direction: "bottom" } ]; self.openDialog = function($event, item) { // Show the dialog $mdDialog.show({ clickOutsideToClose: true, controller: function($mdDialog) { // Save the clicked item this.item = item; // Setup some handlers this.close = function() { $mdDialog.cancel(); }; this.submit = function() { $mdDialog.hide(); }; }, controllerAs: 'dialog', templateUrl: 'dialog.html', targetEvent: $event }); }; }); })();