nexus site path corrected
[portal.git] / ecomp-portal-FE / client / bower_components / angular-material / modules / js / tooltip / tooltip.min.js
1 /*!
2  * Angular Material Design
3  * https://github.com/angular/material
4  * @license MIT
5  * v0.9.8
6  */
7 !function(t,e,o){"use strict";function n(t,o,n,i,l,r,a,d,u){function h(h,s,p){function m(){v(),b(),x(),w(),g()}function v(){e.isDefined(p.mdDelay)||(h.delay=f)}function w(){h.$on("$destroy",function(){h.visible=!1,s.remove(),e.element(o).off("resize",H)}),h.$watch("visible",function(t){t?q():E()})}function g(){k.attr("aria-label")||k.text().trim()||k.attr("aria-label",s.text().trim())}function b(){s.detach(),s.attr("role","tooltip")}function y(){for(var t=s.parent();t&&"none"==o.getComputedStyle(t[0])["pointer-events"];)t=t.parent();return t}function $(){for(var t=s.parent()[0];t&&t!==a[0]&&t!==document.body;)t=t.parentNode;return t}function M(t,n){var i=o.getComputedStyle(s[0]);return e.isDefined(i[t])&&i[t]==n}function x(){var t=!1,n=function(){M("pointer-events","none")||C(!0)},l=function(){var e=h.hasOwnProperty("autohide")?h.autohide:p.hasOwnProperty("mdAutohide");(e||t||i[0].activeElement!==k[0])&&C(!1),t=!1};k.on("mousedown",function(){t=!0}),k.on("focus mouseenter touchstart",n),k.on("blur mouseleave touchend touchcancel",l),e.element(o).on("resize",H)}function C(e){C.value=!!e,C.queued||(e?(C.queued=!0,t(function(){h.visible=C.value,C.queued=!1},h.delay)):t(function(){h.visible=!1}))}function q(){return B.append(s),M("display","none")?(h.visible=!1,void s.detach()):(D(),void e.forEach([s,A,N],function(t){d.addClass(t,"md-show")}))}function E(){u.all([d.removeClass(N,"md-show"),d.removeClass(A,"md-show"),d.removeClass(s,"md-show")]).then(function(){h.visible||s.detach()})}function D(){function t(){var t="left"===P||"right"===P?2*Math.sqrt(Math.pow(n.width,2)+Math.pow(n.height/2,2)):2*Math.sqrt(Math.pow(n.width/2,2)+Math.pow(n.height,2)),e="left"===P?{left:100,top:50}:"right"===P?{left:0,top:50}:"top"===P?{left:50,top:100}:{left:50,top:0};A.css({width:t+"px",height:t+"px",left:e.left+"%",top:e.top+"%"})}function e(t){var e={left:t.left,top:t.top};return e.left=Math.min(e.left,B.prop("scrollWidth")-n.width-c),e.left=Math.max(e.left,c),e.top=Math.min(e.top,B.prop("scrollHeight")-n.height-c),e.top=Math.max(e.top,c),e}function o(t){return"left"===t?{left:i.left-n.width-c,top:i.top+i.height/2-n.height/2}:"right"===t?{left:i.left+i.width+c,top:i.top+i.height/2-n.height/2}:"top"===t?{left:i.left+i.width/2-n.width/2,top:i.top-n.height-c}:{left:i.left+i.width/2-n.width/2,top:i.top+i.height+c}}var n=l.offsetRect(s,B),i=l.offsetRect(k,B),r=o(P);P?r=e(r):r.top>s.prop("offsetParent").scrollHeight-n.height-c&&(r=e(o("top"))),s.css({top:r.top+"px",left:r.left+"px"}),t()}r(s);var k=y(),A=e.element(s[0].getElementsByClassName("md-background")[0]),N=e.element(s[0].getElementsByClassName("md-content")[0]),P=p.mdDirection,z=$(),B=e.element(z||document.body),H=n.throttle(function(){h.visible&&D()});return m()}var f=300,c=8;return{restrict:"E",transclude:!0,priority:210,template:'        <div class="md-background"></div>        <div class="md-content" ng-transclude></div>',scope:{visible:"=?mdVisible",delay:"=?mdDelay",autohide:"=?mdAutohide"},link:h}}e.module("material.components.tooltip",["material.core"]).directive("mdTooltip",n),n.$inject=["$timeout","$window","$$rAF","$document","$mdUtil","$mdTheming","$rootElement","$animate","$q"]}(window,window.angular);