source: trip-planner-front/node_modules/angular-material/modules/closure/tooltip/tooltip.min.js@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 4.6 KB
Line 
1/*!
2 * AngularJS Material Design
3 * https://github.com/angular/material
4 * @license MIT
5 * v1.2.2-master-0a06f99
6 */
7function MdTooltipDirective(y,g,E,x,w,$,T,P){var D="focus touchstart mouseenter",O="blur touchcancel mouseleave",V={top:{x:T.xPosition.CENTER,y:T.yPosition.ABOVE},right:{x:T.xPosition.OFFSET_END,y:T.yPosition.CENTER},bottom:{x:T.xPosition.CENTER,y:T.yPosition.BELOW},left:{x:T.xPosition.OFFSET_START,y:T.yPosition.CENTER}};return{restrict:"E",priority:210,scope:{mdZIndex:"=?mdZIndex",mdDelay:"=?mdDelay",mdVisible:"=?mdVisible",mdAutohide:"=?mdAutohide",mdDirection:"@?mdDirection"},link:function(l,o,a){var n,e,r,d,s,c="md-tooltip-"+$.nextUid(),u=$.getParentWithPointerEvents(o),m=E.throttle(b),f=!1,p=null;function t(){l.mdZIndex=l.mdZIndex||100,l.mdDelay=l.mdDelay||0,V[l.mdDirection]||(l.mdDirection="bottom")}function i(e){var t=e||w(o.text().trim())(l.$parent);(u.attr("aria-label")||u.attr("aria-labelledby"))&&!u.attr("md-labeled-by-tooltip")||(u.attr("aria-label",t),u.attr("md-labeled-by-tooltip")||u.attr("md-labeled-by-tooltip",c))}function b(){t(),d&&d.panelEl&&d.panelEl.removeClass(n),n="md-origin-"+l.mdDirection,e=V[l.mdDirection],r=T.newPanelPosition().relativeTo(u).addPanelPosition(e.x,e.y),d&&d.panelEl&&(d.panelEl.addClass(n),d.updatePosition(r))}function h(e){h.queued&&h.value===!!e||!h.queued&&l.mdVisible===!!e||(h.value=!!e,h.queued||(e?(h.queued=!0,s=y(function(){l.mdVisible=h.value,h.queued=!1,s=null,l.visibleWatcher||v(l.mdVisible)},l.mdDelay)):$.nextTick(function(){l.mdVisible=!1,l.visibleWatcher||v(!1)})))}function v(e){e?function(){if(!o[0].textContent.trim())throw new Error("Text for the tooltip has not been provided. Please include text within the mdTooltip element.");if(!d){var e=angular.element(document.body),t=T.newPanelAnimation().openFrom(u).closeTo(u).withAnimation({open:"md-show",close:"md-hide"}),i={id:c,attachTo:e,contentElement:o,propagateContainerEvents:!0,panelClass:"md-tooltip",animation:t,position:r,zIndex:l.mdZIndex,focusOnOpen:!1,onDomAdded:function(){d.panelEl.addClass(n)}};d=T.create(i)}d.open().then(function(){d.panelEl.attr("role","tooltip")})}():d&&d.close()}t(),i(),o.detach(),b(),function(){if(u[0]&&"MutationObserver"in g){var e=new MutationObserver(function(e){!function(e){return e.some(function(e){return"disabled"===e.attributeName&&u[0].disabled}),!1}(e)||$.nextTick(function(){h(!1)})});e.observe(u[0],{attributes:!0})}function t(){h(!1)}function i(){p=document.activeElement===u[0]}function o(e){"focus"===e.type&&p?p=!1:l.mdVisible||(u.on(O,n),h(!0),"touchstart"===e.type&&u.one("touchend",function(){$.nextTick(function(){x.one("touchend",n)},!1)}))}function n(){((l.hasOwnProperty("mdAutohide")?l.mdAutohide:a.hasOwnProperty("mdAutohide"))||f||x[0].activeElement!==u[0])&&(s&&(y.cancel(s),h.queued=!1,s=null),u.off(O,n),u.triggerHandler("blur"),h(!1)),f=!1}function r(){f=!0}p=!1,P.register("scroll",t,!0),P.register("blur",i),P.register("resize",m),l.$on("$destroy",function(){P.deregister("scroll",t,!0),P.deregister("blur",i),P.deregister("resize",m),u.off(D,o).off(O,n).off("mousedown",r),n(),e&&e.disconnect()}),u.on("mousedown",r),u.on(D,o)}(),function(){if(o[0]&&"MutationObserver"in g){var e=new MutationObserver(function(e){e.forEach(function(e){"md-visible"!==e.attributeName||l.visibleWatcher||(l.visibleWatcher=l.$watch("mdVisible",v))})});e.observe(o[0],{attributes:!0}),a.hasOwnProperty("mdVisible")&&(l.visibleWatcher=l.$watch("mdVisible",v))}else l.visibleWatcher=l.$watch("mdVisible",v);function t(){l.$destroy()}l.$watch("mdDirection",b),o.one("$destroy",t),u.one("$destroy",t),l.$on("$destroy",function(){h(!1),d&&d.destroy(),e&&e.disconnect(),o.remove()}),-1<o.text().indexOf(w.startSymbol())&&l.$watch(function(){return o.text().trim()},i)}()}}}function MdTooltipRegistry(){var r={},l=angular.element(window);return{register:function(e,t,i){var o=r[e]=r[e]||[];o.length||(i?window.addEventListener(e,a,!0):l.on(e,a));-1===o.indexOf(t)&&o.push(t)},deregister:function(e,t,i){var o=r[e],n=o?o.indexOf(t):-1;-1<n&&(o.splice(n,1),0===o.length&&(i?window.removeEventListener(e,a,!0):l.off(e,a)))}};function a(t){r[t.type]&&r[t.type].forEach(function(e){e.call(this,t)},this)}}goog.provide("ngmaterial.components.tooltip"),goog.require("ngmaterial.components.panel"),goog.require("ngmaterial.core"),MdTooltipDirective.$inject=["$timeout","$window","$$rAF","$document","$interpolate","$mdUtil","$mdPanel","$$mdTooltipRegistry"],angular.module("material.components.tooltip",["material.core","material.components.panel"]).directive("mdTooltip",MdTooltipDirective).service("$$mdTooltipRegistry",MdTooltipRegistry),ngmaterial.components.tooltip=angular.module("material.components.tooltip");
Note: See TracBrowser for help on using the repository browser.