Skip to content
Browse files

added minified version

  • Loading branch information...
1 parent 6c11631 commit 3003c992645058d87d9bb82606402784fb53ecad @annavester committed Mar 2, 2013
Showing with 2 additions and 1 deletion.
  1. +1 −1 index.html
  2. +1 −0 tooltip.min.js
View
2 index.html
@@ -23,7 +23,7 @@
</div>
</div>
- <script src="tooltip.js"></script>
+ <script src="tooltip.min.js"></script>
<script>
window.onload = function() {
var tt = new Tooltip();
View
1 tooltip.min.js
@@ -0,0 +1 @@
+var Tooltip=function(){"use strict";function s(e){if(!a(e)){for(var t in i){if(!a(e[t]))i[t]=e[t]}}return i}function o(e){if(typeof document.getElementsByClassName==="function"){return document.getElementsByClassName(e)}else{return u(e)}}function u(t){var n=e.getElementsByTagName("*"),r=n.length,i=undefined,s=[],o=0,u;for(;o<r;o++){u=n[o];if(!a(u))break;i=u.getAttribute("class");if(i!==null&&i.indexOf(t)!==-1){s.push(u)}}return s}function a(e){return!!(typeof e==="undefined")}var e=document.getElementsByTagName("body")[0],t=undefined,n=undefined,r="tooltip-container",i={opacity:"1",hideOnMouseOut:true};return function(){function f(t){if(o(r).length>0)l();var i=t.target,s=i.getAttribute("data-tt-type"),u=document.createDocumentFragment(),a=document.createElement("div"),f=t.pageX,c=t.pageY,h;u.appendChild(a);a.className=r;a.style.cssText="left:"+f+"px;top:"+c+"px;";if(s==="element"){h=i.parentNode.nextElementSibling.innerHTML;a.innerHTML=h}else{h=i.getAttribute("title");a.innerHTML=h}if(n.hideOnMouseOut){this.addEventListener("mouseout",l)}else{var p=document.createElement("a");p.innerText="x";p.className="hideTooltip";p.addEventListener("click",l);a.appendChild(p)}e.appendChild(u);i.setAttribute("data-status","active")}function l(t){if(!a(t)&&t.type==="click")t.preventDefault();var n=o(r),i=n.length,s=0;for(;s<i;++s){e.removeChild(n[s])}}var u=function(r){var i=0,u,a;n=s(r);t=o("tooltip");a=t.length;for(;i<a;++i){u=t[i];u.addEventListener("mouseover",f)}};return{init:u}}}();

0 comments on commit 3003c99

Please sign in to comment.
Something went wrong with that request. Please try again.