From 4ad39a5c96dd99acf819ce189b13fec946d7506b Mon Sep 17 00:00:00 2001 From: talasila Date: Tue, 7 Feb 2017 15:03:57 -0500 Subject: Initial OpenECOMP Portal commit Change-Id: I804b80e0830c092e307da1599bd9fbb5c3e2da77 Signed-off-by: talasila --- .../modules/closure/button/button.js | 135 +++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/button/button.js (limited to 'ecomp-portal-FE/client/bower_components/angular-material/modules/closure/button/button.js') diff --git a/ecomp-portal-FE/client/bower_components/angular-material/modules/closure/button/button.js b/ecomp-portal-FE/client/bower_components/angular-material/modules/closure/button/button.js new file mode 100644 index 00000000..1f40622b --- /dev/null +++ b/ecomp-portal-FE/client/bower_components/angular-material/modules/closure/button/button.js @@ -0,0 +1,135 @@ +/*! + * Angular Material Design + * https://github.com/angular/material + * @license MIT + * v0.9.8 + */ +goog.provide('ng.material.components.button'); +goog.require('ng.material.core'); +/** + * @ngdoc module + * @name material.components.button + * @description + * + * Button + */ +angular + .module('material.components.button', [ 'material.core' ]) + .directive('mdButton', MdButtonDirective); + +/** + * @ngdoc directive + * @name mdButton + * @module material.components.button + * + * @restrict E + * + * @description + * `` is a button directive with optional ink ripples (default enabled). + * + * If you supply a `href` or `ng-href` attribute, it will become an `` element. Otherwise, it will + * become a `'; + } + + function postLink(scope, element, attr) { + var node = element[0]; + $mdTheming(element); + $mdButtonInkRipple.attach(scope, element); + + var elementHasText = node.textContent.trim(); + if (!elementHasText) { + $mdAria.expect(element, 'aria-label'); + } + + // For anchor elements, we have to set tabindex manually when the + // element is disabled + if (isAnchor(attr) && angular.isDefined(attr.ngDisabled) ) { + scope.$watch(attr.ngDisabled, function(isDisabled) { + element.attr('tabindex', isDisabled ? -1 : 0); + }); + } + + // disabling click event when disabled is true + element.on('click', function(e){ + if (attr.disabled === true) { + e.preventDefault(); + e.stopImmediatePropagation(); + } + }); + + // restrict focus styles to the keyboard + scope.mouseActive = false; + element.on('mousedown', function() { + scope.mouseActive = true; + $timeout(function(){ + scope.mouseActive = false; + }, 100); + }) + .on('focus', function() { + if(scope.mouseActive === false) { element.addClass('md-focused'); } + }) + .on('blur', function() { element.removeClass('md-focused'); }); + } + +} +MdButtonDirective.$inject = ["$mdButtonInkRipple", "$mdTheming", "$mdAria", "$timeout"]; + +ng.material.components.button = angular.module("material.components.button"); \ No newline at end of file -- cgit 1.2.3-korg