diff --git a/Readme.md b/Readme.md index a190b82..ff4499a 100644 --- a/Readme.md +++ b/Readme.md @@ -98,7 +98,7 @@ tooltip-speed="" | String('fast', 'slow', 'medium') | 'medium' | Set your toolti tooltip-hidden="" | String(Boolean) | false | Hide (at all) the tooltip tooltip-append-to-body="" | String(Boolean) | false | This attribute clones the tooltip and append this directly on body. This enables the tooltip position also, for instance, if you have an scrolling area. **This option does heavy javascript calculation.** tooltip-show="" | String(Boolean) | false | Show/Hide the tooltip "manually" - +tooltip-flash-time="" | String(Integer) | null | Number of milliseconds before the tooltip automatically dissapears ## Globals Sometimes you may need to set all of your tooltips options in one place, you can achieve this using `tooltipsConfProvider` like this: @@ -110,6 +110,7 @@ Sometimes you may need to set all of your tooltips options in one place, you can 'size': 'large', 'speed': 'slow', 'tooltipTemplateUrlCache': true + 'flashTime': '2000' //etc... }); }]) diff --git a/dist/angular-tooltips.css b/dist/angular-tooltips.css index c075e9b..d062e52 100644 --- a/dist/angular-tooltips.css +++ b/dist/angular-tooltips.css @@ -6,7 +6,7 @@ * http://720kb.github.io/angular-tooltips * * MIT license - * Tue Jun 20 2017 + * Fri Jul 06 2018 */ @-webkit-keyframes animate-tooltip { 0% { diff --git a/dist/angular-tooltips.css.map b/dist/angular-tooltips.css.map deleted file mode 100644 index 70fb17b..0000000 --- a/dist/angular-tooltips.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["angular-tooltips.css"],"names":[],"mappings":";;;;;;;;;;AAAA","file":"angular-tooltips.css","sourceRoot":"../lib"} \ No newline at end of file diff --git a/dist/angular-tooltips.js b/dist/angular-tooltips.js index cc3d54a..c197d73 100644 --- a/dist/angular-tooltips.js +++ b/dist/angular-tooltips.js @@ -6,7 +6,7 @@ * http://720kb.github.io/angular-tooltips * * MIT license - * Tue Jun 20 2017 + * Fri Jul 06 2018 */ /*global angular,window*/ (function withAngular(angular, window) { @@ -145,6 +145,12 @@ element.removeAttr('tooltip-speed'); } + if (element.attr('tooltip-flash-time') !== undefined) { + + attributesToAdd['tooltip-flash-time'] = element.attr('tooltip-flash-time'); + element.removeAttr('tooltip-flash-time'); + } + return attributesToAdd; } , getStyle = function getStyle(anElement) { @@ -251,7 +257,8 @@ 'size': '', 'speed': 'steady', 'tooltipTemplateUrlCache': false, - 'show': null + 'show': null, + 'flashTime': null }; return { @@ -312,6 +319,7 @@ $attrs.tooltipSize = $attrs.tooltipSize || tooltipsConf.size; $attrs.tooltipSpeed = $attrs.tooltipSpeed || tooltipsConf.speed; $attrs.tooltipAppendToBody = $attrs.tooltipAppendToBody === 'true'; + $attrs.tooltipFlashTime = $attrs.tooltipFlashTime || tooltipsConf.flashTime; $transcludeFunc($scope, function onTransclusionDone(element, scope) { var attributes = getAttributesToAdd(element) @@ -321,6 +329,7 @@ , tipTipElement = angular.element(window.document.createElement('tip-tip')) , closeButtonElement = angular.element(window.document.createElement('span')) , tipArrowElement = angular.element(window.document.createElement('tip-arrow')) + , flashTimer , whenActivateMultilineCalculation = function whenActivateMultilineCalculation() { return tipContElement.html(); @@ -336,8 +345,22 @@ tooltipElement.removeClass('_multiline'); } } - , onTooltipShow = function onTooltipShow(event) { + , onTooltipHide = function onTooltipHide(event) { + if (event && tooltipElement.hasClass('active')) { + + event.stopImmediatePropagation(); + } + + if ($attrs.tooltipAppendToBody) { + + removeAppendedTip(tooltipElement); + } else { + + tooltipElement.removeClass('active'); + } + } + , onTooltipShow = function onTooltipShow(event) { if (event && !tooltipElement.hasClass('active')) { event.stopImmediatePropagation(); @@ -462,20 +485,20 @@ tooltipElement.addClass('active'); } } - } - , onTooltipHide = function onTooltipHide(event) { - if (event && tooltipElement.hasClass('active')) { - - event.stopImmediatePropagation(); - } + if ($attrs.tooltipFlashTime) { - if ($attrs.tooltipAppendToBody) { + if (flashTimer) { - removeAppendedTip(tooltipElement); - } else { + $timeout.cancel(flashTimer); + } + + flashTimer = $timeout(function hideTooltip() { + + onTooltipHide(event); + + }, parseInt($attrs.tooltipFlashTime, 10)); - tooltipElement.removeClass('active'); } } , registerOnScrollFrom = function registerOnScrollFrom(theElement) { diff --git a/dist/angular-tooltips.js.map b/dist/angular-tooltips.js.map deleted file mode 100644 index 0c3cd91..0000000 --- a/dist/angular-tooltips.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["angular-tooltips.js"],"names":["angular","window","directiveName","resizeObserver","resizeTimeout","callbacks","lastTime","runCallbacks","currentTime","forEach","callback","console","log","resize","clearTimeout","setTimeout","requestAnimationFrame","addCallback","push","add","length","addEventListener","remove","removeEventListener","getAttributesToAdd","element","attributesToAdd","removeAttr","undefined","attr","getStyle","anElement","getComputedStyle","currentStyle","getAppendedTip","theTooltipElement","aTipInBody","angularizedElement","tipsInBody","document","querySelectorAll","tipsInBodyIndex","tipsInBodyLength","item","data","removeAppendedTip","tipElement","isOutOfPage","theTipElement","squarePosition","getBoundingClientRect","top","body","offsetHeight","left","offsetWidth","bottom","right","css","Error","getSideClasses","sides","split","map","side","join","directions","smartPosition","tooltipElement","startSide","directionsIndex","indexOf","directionsLength","directionsCount","removeClass","addClass","tooltipConfigurationProvider","tooltipConfiguration","showTrigger","hideTrigger","class","smart","closeButton","size","speed","tooltipTemplateUrlCache","show","configure","configuration","aConfigurationKey","configurationKeys","Object","keys","configurationIndex","$get","tooltipDirective","$log","$http","$compile","$timeout","$controller","$injector","tooltipsConf","$templateCache","$q","linkingFunction","$scope","$element","$attrs","$controllerDirective","$transcludeFunc","tooltipTemplate","tooltipTemplateUrl","tooltipController","oldTooltipClass","oldTooltipSide","oldTooltipShowTrigger","oldTooltipHideTrigger","oldSize","oldSpeed","tooltipSide","tooltipShowTrigger","tooltipHideTrigger","tooltipShow","tooltipClass","tooltipSmart","tooltipCloseButton","toString","tooltipSize","tooltipSpeed","tooltipAppendToBody","scope","attributes","createElement","tipContElement","tipTipElement","closeButtonElement","tipArrowElement","whenActivateMultilineCalculation","html","calculateIfMultiLine","newValue","getClientRects","onTooltipShow","event","hasClass","stopImmediatePropagation","aStyleKey","paddingTopValue","paddingBottomValue","paddingLeftValue","paddingRightValue","tipTipElementStyle","tipArrowElementStyle","tipElementStyle","tipElementBoundingClientRect","exradicatedTipElement","copy","tipTipStyleIndex","tipTipStyleLength","tipArrowStyleIndex","tipArrowStyleLength","tipStyleIndex","tipStyleLength","tipTipCssToSet","tipCssToSet","tipArrowCssToSet","getPropertyValue","parseInt","pageYOffset","pageXOffset","height","width","children","next","tooltipHidden","append","onTooltipHide","registerOnScrollFrom","theElement","timer","parentElement","parent","scrollHeight","clientHeight","scrollWidth","clientWidth","on","that","this","cancel","tooltipBoundingRect","thatBoundingRect","showTemplate","template","empty","hideTemplate","getTemplate","get","resolve","then","response","put","onTooltipTemplateChange","onTooltipTemplateUrlChange","reason","error","onTooltipTemplateUrlCacheChange","onTooltipSideChange","onTooltipShowTrigger","off","onTooltipHideTrigger","onTooltipShowTooltip","onTooltipClassChange","onTooltipSmartChange","onTooltipCloseButtonChange","enableButton","onTooltipTemplateControllerChange","controllerName","tipController","newScope","$new","indexOfAs","substr","extend","replaceWith","unregisterOnTooltipControllerChange","onTooltipSizeChange","onTooltipSpeedChange","unregisterOnTooltipTemplateChange","$observe","unregisterOnTooltipTemplateUrlChange","unregisterOnTooltipTemplateUrlCacheChange","unregisterOnTooltipSideChangeObserver","unregisterOnTooltipShowTrigger","unregisterOnTooltipHideTrigger","unregisterOnTooltipShowTooltip","unregisterOnTooltipClassChange","unregisterOnTooltipSmartChange","unregisterOnTooltipCloseButtonChange","unregisterOnTooltipSizeChange","unregisterOnTooltipSpeedChange","unregisterTipContentChangeWatcher","$watch","after","$on","restrict","transclude","priority","terminal","link","module","provider","directive"],"mappings":";;;;;;;;;;CAWC,SAAqBA,EAASC,GAC7B,YAEA,IAAIC,GAAgB,WAClBC,EAAkB,WAElB,GAgBIC,GAhBAC,KACAC,EAAW,EACXC,EAAe,SAAsBC,GAEjCA,EAAcF,GAAY,IAE5BD,EAAUI,QAAQ,SAAkBC,GAElCA,MAEFJ,EAAWE,GAG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vBjE,EAAegB,IAAI,WAEjByH,IACAG,MAGF5C,EAAS,WAEP4C,IACAjG,EAAW4B,YAAY,WACvBN,EAAeO,SAAS,YAG1BwD,EAAMkH,IAAI,WAAY,WAEpBhB,KACAE,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACA/O,EAAemB,SACfG,EAAQyL,IAAItG,EAAOa,mBAAqB,IAAMb,EAAOc,wBAK3D,QACE4H,SAAY,IACZC,WAAc,UACdC,SAAY,EACZC,UAAY,EACZC,KAAQjJ,IAIZzG,GAAQ2P,OAAO,qBACdC,SAAS1P,EAAgB,OAAQ0E,GACjCiL,UAAU3P,EAAe6F,IAC1B/F,QAASC","file":"angular-tooltips.js","sourceRoot":"../lib"} \ No newline at end of file diff --git a/dist/angular-tooltips.min.css b/dist/angular-tooltips.min.css deleted file mode 100644 index 0877aab..0000000 --- a/dist/angular-tooltips.min.css +++ /dev/null @@ -1,12 +0,0 @@ -/* - * angular-tooltips - * 1.2.2 - * - * Angular.js tooltips module. - * http://720kb.github.io/angular-tooltips - * - * MIT license - * Tue Jun 20 2017 - */ -tooltip._bottom:not(._left):not(._right) tip tip-arrow,tooltip._top:not(._left):not(._right) tip tip-arrow{border-left:6px solid transparent;border-right:6px solid transparent;left:50%;margin-left:-6px;content:'';height:0}@-webkit-keyframes animate-tooltip{0%{opacity:0}50%{opacity:.5}60%{opacity:.8}70%{opacity:.9}90%{opacity:1}}@-moz-keyframes animate-tooltip{0%{opacity:0}50%{opacity:.5}60%{opacity:.8}70%{opacity:.9}90%{opacity:1}}@-ms-keyframes animate-tooltip{0%{opacity:0}50%{opacity:.5}60%{opacity:.8}70%{opacity:.9}90%{opacity:1}}@keyframes animate-tooltip{0%{opacity:0}50%{opacity:.5}60%{opacity:.8}70%{opacity:.9}90%{opacity:1}}._exradicated-tooltip{display:block;opacity:1;position:absolute;z-index:999}tooltip{display:inline-block;position:relative}tooltip._multiline{display:block}tooltip._slow._ready tip{animation:animate-tooltip .65s}tooltip._fast._ready tip{animation:animate-tooltip .15s}tooltip._steady._ready tip{animation:animate-tooltip .35s}tooltip tip{border-radius:3px;background:rgba(0,0,0,.85);color:#fff;display:none;line-height:normal;max-width:500px;min-width:100px;opacity:0;padding:8px 16px;position:absolute;text-align:center;width:auto;will-change:top,left,bottom,right}tooltip tip._hidden{display:block;visibility:hidden}tooltip.active:not(._force-hidden) tip{display:block;opacity:1;z-index:999}tooltip tip-tip{font-size:.95em}tooltip tip-tip._large{font-size:1.1em}tooltip tip-tip._small{font-size:.8em}tooltip._top:not(._left):not(._right) tip{left:50%;top:-9px;-webkit-transform:translateX(-50%) translateY(-100%);transform:translateX(-50%) translateY(-100%)}tooltip._top:not(._left):not(._right) tip tip-arrow{border-top:6px solid rgba(0,0,0,.85);position:absolute;top:100%;width:0}tooltip._bottom:not(._left):not(._right) tip{right:50%;top:100%;-webkit-transform:translateX(50%) translateY(9px);transform:translateX(50%) translateY(9px)}tooltip._bottom:not(._left):not(._right) tip tip-arrow{border-bottom:6px solid rgba(0,0,0,.85);bottom:100%;position:absolute;width:0}tooltip._right:not(._top):not(._bottom) tip{left:100%;top:50%;-webkit-transform:translateX(9px) translateY(-50%);transform:translateX(9px) translateY(-50%)}tooltip._right:not(._top):not(._bottom) tip tip-arrow{border-bottom:6px solid transparent;border-right:6px solid rgba(0,0,0,.85);border-top:6px solid transparent;content:'';height:0;margin-top:-6px;position:absolute;right:100%;top:50%;width:0}tooltip._left:not(._top):not(._bottom) tip{left:-9px;top:50%;-webkit-transform:translateX(-100%) translateY(-50%);transform:translateX(-100%) translateY(-50%)}tooltip._left:not(._top):not(._bottom) tip tip-arrow{border-bottom:6px solid transparent;border-left:6px solid rgba(0,0,0,.85);border-top:6px solid transparent;content:'';height:0;left:100%;margin-top:-6px;position:absolute;top:50%;width:0}tooltip._top._left tip tip-arrow,tooltip._top._right tip tip-arrow{border-top:6px solid rgba(0,0,0,.85);border-left:6px solid transparent;border-right:6px solid transparent;content:'';height:0;margin-left:-6px;position:absolute;width:0}tooltip._top._left tip{left:-9px;top:-9px;-webkit-transform:translateX(-100%) translateY(-100%);transform:translateX(-100%) translateY(-100%)}tooltip._top._left tip tip-arrow{left:90%;top:100%}tooltip._top._right tip{left:100%;top:-9px;-webkit-transform:translateX(9px) translateY(-100%);transform:translateX(9px) translateY(-100%)}tooltip._top._right tip tip-arrow{left:10%;top:100%}tooltip._bottom._left tip{left:-9px;top:100%;-webkit-transform:translateX(-100%) translateY(9px);transform:translateX(-100%) translateY(9px)}tooltip._bottom._left tip tip-arrow{border-bottom:6px solid rgba(0,0,0,.85);border-left:6px solid transparent;border-right:6px solid transparent;bottom:100%;content:'';height:0;left:90%;margin-left:-6px;position:absolute;width:0}tooltip._bottom._right tip{left:100%;top:100%;-webkit-transform:translateX(9px) translateY(9px);transform:translateX(9px) translateY(9px)}tooltip._bottom._right tip tip-arrow{border-bottom:6px solid rgba(0,0,0,.85);border-left:6px solid transparent;border-right:6px solid transparent;bottom:100%;content:'';height:0;left:10%;margin-left:-6px;position:absolute;width:0}tip-tip .close-button{cursor:pointer;float:right;left:8%;margin-top:-7%;padding:3px;position:relative} -/*# sourceMappingURL=angular-tooltips.css.map */ diff --git a/dist/angular-tooltips.min.js b/dist/angular-tooltips.min.js deleted file mode 100644 index 7e6cb91..0000000 --- a/dist/angular-tooltips.min.js +++ /dev/null @@ -1,12 +0,0 @@ -/* - * angular-tooltips - * 1.2.2 - * - * Angular.js tooltips module. - * http://720kb.github.io/angular-tooltips - * - * MIT license - * Tue Jun 20 2017 - */ -!function(t,o){"use strict";var e="tooltips",i=function(){var t,e=[],i=0,r=function(t){t-i>=15?(e.forEach(function(t){t()}),i=t):o.console.log("Skipped!")},l=function(){o.clearTimeout(t),t=o.setTimeout(function(){o.requestAnimationFrame(r)},500)},n=function(t){t&&e.push(t)};return{add:function(t){e.length||o.addEventListener("resize",l),n(t)},remove:function(){e.length||(o.clearTimeout(t),o.removeEventListener("resize",l))}}}(),r=function(t){var o={};return t.removeAttr(e),void 0!==t.attr("tooltip-template")&&(o["tooltip-template"]=t.attr("tooltip-template"),t.removeAttr("tooltip-template")),void 0!==t.attr("tooltip-template-url")&&(o["tooltip-template-url"]=t.attr("tooltip-template-url"),t.removeAttr("tooltip-template-url")),void 0!==t.attr("tooltip-template-url-cache")&&(o["tooltip-template-url-cache"]=t.attr("tooltip-template-url-cache"),t.removeAttr("tooltip-template-url-cache")),void 0!==t.attr("tooltip-controller")&&(o["tooltip-controller"]=t.attr("tooltip-controller"),t.removeAttr("tooltip-controller")),void 0!==t.attr("tooltip-side")&&(o["tooltip-side"]=t.attr("tooltip-side"),t.removeAttr("tooltip-side")),void 0!==t.attr("tooltip-show-trigger")&&(o["tooltip-show-trigger"]=t.attr("tooltip-show-trigger"),t.removeAttr("tooltip-show-trigger")),void 0!==t.attr("tooltip-hide-trigger")&&(o["tooltip-hide-trigger"]=t.attr("tooltip-hide-trigger"),t.removeAttr("tooltip-hide-trigger")),void 0!==t.attr("tooltip-smart")&&(o["tooltip-smart"]=t.attr("tooltip-smart"),t.removeAttr("tooltip-smart")),void 0!==t.attr("tooltip-class")&&(o["tooltip-class"]=t.attr("tooltip-class"),t.removeAttr("tooltip-class")),void 0!==t.attr("tooltip-show")&&(o["tooltip-show"]=t.attr("tooltip-show"),t.removeAttr("tooltip-show")),void 0!==t.attr("tooltip-close-button")&&(o["tooltip-close-button"]=t.attr("tooltip-close-button"),t.removeAttr("tooltip-close-button")),void 0!==t.attr("tooltip-size")&&(o["tooltip-size"]=t.attr("tooltip-size"),t.removeAttr("tooltip-size")),void 0!==t.attr("tooltip-speed")&&(o["tooltip-speed"]=t.attr("tooltip-speed"),t.removeAttr("tooltip-speed")),o},l=function(t){return o.getComputedStyle?o.getComputedStyle(t,""):t.currentStyle?t.currentStyle:void 0},n=function(e){for(var i,r,l=o.document.querySelectorAll("._exradicated-tooltip"),n=0,p=l.length;no.document.body.offsetHeight||e.left<0||e.left>o.document.body.offsetWidth||e.bottom<0||e.bottom>o.document.body.offsetHeight||e.right<0||e.right>o.document.body.offsetWidth)&&(t.css({top:"",left:"",bottom:"",right:""}),!0)}throw new Error("You must provide a position")},s=function(t){return t.split(" ").map(function(t){return"_"+t}).join(" ")},d=["_top","_top _left","_left","_bottom _left","_bottom","_bottom _right","_right","_top _right"],c=function(t,o,e){for(var i=d.indexOf(s(e)),r=d.length,l=0;l=d.length&&(i=0),o.removeClass("_top _left _bottom _right"),o.addClass(d[i])},u=function(){var t={side:"top",showTrigger:"mouseenter",hideTrigger:"mouseleave","class":"",smart:!1,closeButton:!1,size:"",speed:"steady",tooltipTemplateUrlCache:!1,show:null};return{configure:function(o){var e,i=Object.keys(t),r=0;if(o)for(;r1?w.addClass("_multiline"):w.removeClass("_multiline")},k=function(e){if(e&&!w.hasClass("active")&&e.stopImmediatePropagation(),E.addClass("_hidden"),b.tooltipSmart)switch(b.tooltipSide){case"top":case"left":case"bottom":case"right":case"top left":case"top right":case"bottom left":case"bottom right":c(E,w,b.tooltipSide);break;default:throw new Error("Position not supported")}if(b.tooltipAppendToBody){var i,r,n,a,s,d=l(P[0]),u=l(H[0]),m=l(E[0]),f=E[0].getBoundingClientRect(),g=t.copy(E),h=0,v=d.length,C=0,y=u.length,_=0,T=m.length,S={},$={},A={};for(E.removeClass("_hidden"),g.removeClass("_hidden"),g.data("_tooltip-parent",w),p(w);ht[0].clientHeight||t[0].scrollWidth>t[0].clientWidth)&&t.on("scroll",function(){var t=this;o&&u.cancel(o),o=u(function(){var o=n(w),e=w[0].getBoundingClientRect(),i=t.getBoundingClientRect();e.topi.bottom||e.lefti.right?p(w):o&&k(!0)})}),e&&e.length&&ft(e)},R=function(t){w.removeClass("_force-hidden"),P.empty(),P.append(x),P.append(t),u(function(){k()})},W=function(){P.empty(),w.addClass("_force-hidden")},Y=function(t){var o=h.get(t);return"undefined"!=typeof o?v.resolve(o):a.get(t).then(function(o){return h.put(t,o.data),o.data})},j=function(t){t?R(t):W()},q=function(t){t&&!b.tooltipTemplateUrlCache?Y(t).then(function(t){R(d(t)(g))})["catch"](function(t){e.error(t)}):W()},L=function(t){t&&b.tooltipTemplateUrl?Y(b.tooltipTemplateUrl).then(function(t){R(d(t)(g))})["catch"](function(t){e.error(t)}):W()},F=function(t){t&&(T&&w.removeClass(T),w.addClass(s(t)),T=t)},X=function(t){t&&(S&&w.off(S),w.on(t,k),S=t)},D=function(t){t&&($&&w.off($),w.on(t,I),$=t)},G=function(t){"true"===t?w.addClass("active"):w.removeClass("active")},J=function(t){t&&(_&&E.removeClass(_),E.addClass(t),_=t)},K=function(){"boolean"!=typeof b.tooltipSmart&&(b.tooltipSmart="true"===b.tooltipSmart)},M=function(t){var o="true"===t;o?(x.on("click",I),x.css("display","block")):(x.off("click"),x.css("display","none"))},N=function(o){if(o){var e,i=m(o,{$scope:g}),r=g.$new(!1,g),l=o.indexOf("as");l>=0?(e=o.substr(l+3),r[e]=i):t.extend(r,i),P.replaceWith(d(P)(r)),dt()}},Q=function(t){t&&(A&&P.removeClass("_"+A),P.addClass("_"+t),A=t)},Z=function(t){t&&(B&&w.removeClass("_"+B),w.addClass("_"+t),B=t)},tt=b.$observe("tooltipTemplate",j),ot=b.$observe("tooltipTemplateUrl",q),et=b.$observe("tooltipTemplateUrlCache",L),it=b.$observe("tooltipSide",F),rt=b.$observe("tooltipShowTrigger",X),lt=b.$observe("tooltipHideTrigger",D),nt=b.$observe("tooltipShow",G),pt=b.$observe("tooltipClass",J),at=b.$observe("tooltipSmart",K),st=b.$observe("tooltipCloseButton",M),dt=b.$observe("tooltipController",N),ct=b.$observe("tooltipSize",Q),ut=b.$observe("tooltipSpeed",Z),mt=g.$watch(V,U);x.addClass("close-button"),x.html("×"),E.addClass("_hidden"),P.append(x),P.append(b.tooltipTemplate),E.append(P),E.append(H),z.append(f),w.attr(y),w.addClass("tooltips"),w.append(z),w.append(E),C.after(w),b.tooltipAppendToBody&&(i.add(function(){O(w)}),O(w)),i.add(function(){U(),k()}),u(function(){k(),E.removeClass("_hidden"),w.addClass("_ready")}),g.$on("$destroy",function(){tt(),ot(),et(),it(),rt(),lt(),nt(),pt(),at(),st(),ct(),ut(),mt(),i.remove(),f.off(b.tooltipShowTrigger+" "+b.tooltipHideTrigger)})})};return{restrict:"A",transclude:"element",priority:1,terminal:!0,link:C}}];t.module("720kb.tooltips",[]).provider(e+"Conf",u).directive(e,m)}(angular,window); -//# sourceMappingURL=angular-tooltips.js.map diff --git a/index.html b/index.html index dfbe756..a7b2337 100644 --- a/index.html +++ b/index.html @@ -441,6 +441,22 @@ +
+ + Tooltip that auto-dissapears in 5 seconds + +
+ +
+ + Tooltip that auto-dissapears in 2 seconds + +
+ diff --git a/lib/angular-tooltips.js b/lib/angular-tooltips.js index cf55c00..45a698b 100644 --- a/lib/angular-tooltips.js +++ b/lib/angular-tooltips.js @@ -135,6 +135,12 @@ element.removeAttr('tooltip-speed'); } + if (element.attr('tooltip-flash-time') !== undefined) { + + attributesToAdd['tooltip-flash-time'] = element.attr('tooltip-flash-time'); + element.removeAttr('tooltip-flash-time'); + } + return attributesToAdd; } , getStyle = function getStyle(anElement) { @@ -241,7 +247,8 @@ 'size': '', 'speed': 'steady', 'tooltipTemplateUrlCache': false, - 'show': null + 'show': null, + 'flashTime': null }; return { @@ -302,6 +309,7 @@ $attrs.tooltipSize = $attrs.tooltipSize || tooltipsConf.size; $attrs.tooltipSpeed = $attrs.tooltipSpeed || tooltipsConf.speed; $attrs.tooltipAppendToBody = $attrs.tooltipAppendToBody === 'true'; + $attrs.tooltipFlashTime = $attrs.tooltipFlashTime || tooltipsConf.flashTime; $transcludeFunc($scope, function onTransclusionDone(element, scope) { var attributes = getAttributesToAdd(element) @@ -311,6 +319,7 @@ , tipTipElement = angular.element(window.document.createElement('tip-tip')) , closeButtonElement = angular.element(window.document.createElement('span')) , tipArrowElement = angular.element(window.document.createElement('tip-arrow')) + , flashTimer , whenActivateMultilineCalculation = function whenActivateMultilineCalculation() { return tipContElement.html(); @@ -326,8 +335,22 @@ tooltipElement.removeClass('_multiline'); } } - , onTooltipShow = function onTooltipShow(event) { + , onTooltipHide = function onTooltipHide(event) { + if (event && tooltipElement.hasClass('active')) { + + event.stopImmediatePropagation(); + } + + if ($attrs.tooltipAppendToBody) { + + removeAppendedTip(tooltipElement); + } else { + + tooltipElement.removeClass('active'); + } + } + , onTooltipShow = function onTooltipShow(event) { if (event && !tooltipElement.hasClass('active')) { event.stopImmediatePropagation(); @@ -452,20 +475,20 @@ tooltipElement.addClass('active'); } } - } - , onTooltipHide = function onTooltipHide(event) { - if (event && tooltipElement.hasClass('active')) { - - event.stopImmediatePropagation(); - } + if ($attrs.tooltipFlashTime) { - if ($attrs.tooltipAppendToBody) { + if (flashTimer) { - removeAppendedTip(tooltipElement); - } else { + $timeout.cancel(flashTimer); + } + + flashTimer = $timeout(function hideTooltip() { + + onTooltipHide(event); + + }, parseInt($attrs.tooltipFlashTime, 10)); - tooltipElement.removeClass('active'); } } , registerOnScrollFrom = function registerOnScrollFrom(theElement) {