lib/har/viewer/scripts/domplate/infoTip.js in har-0.0.9 vs lib/har/viewer/scripts/domplate/infoTip.js in har-0.1.0

- old
+ new

@@ -1,4 +2 @@ -require.def("domplate/infoTip",["domplate/domplate","core/lib","core/trace"],function(e,b){with(e){e=b.extend({listeners:[],maxWidth:100,maxHeight:80,infoTipMargin:10,infoTipWindowPadding:25,tags:domplate({infoTipTag:DIV({"class":"infoTip"})}),initialize:function(){if(!$.browser.msie){var a=$("body");a.bind("mouseover",b.bind(this.onMouseMove,this));a.bind("mouseout",b.bind(this.onMouseOut,this));a.bind("mousemove",b.bind(this.onMouseMove,this));return this.infoTip=this.tags.infoTipTag.append({}, -b.getBody(document))}},showInfoTip:function(a,c,f,g,d,i){var h=b.getOverflowParent(c);if(b.dispatch2(this.listeners,"showInfoTip",[a,c,f+(h?h.scrollLeft:0),g,d,i])){d=a.ownerDocument.documentElement;c=d.clientWidth;d=d.clientHeight;if(f+a.offsetWidth+this.infoTipMargin>c-this.infoTipWindowPadding){a.style.left="auto";a.style.right=c-f+this.infoTipMargin+"px"}else{a.style.left=f+this.infoTipMargin+"px";a.style.right="auto"}a.style.top=g+a.offsetHeight+this.infoTipMargin>d?Math.max(0,d-(a.offsetHeight+ -this.infoTipMargin))+"px":g+this.infoTipMargin+"px";a.style.bottom="auto";a.setAttribute("active","true")}else this.hideInfoTip(a)},hideInfoTip:function(a){a&&a.removeAttribute("active")},onMouseOut:function(a){a.relatedTarget||this.hideInfoTip(this.infoTip)},onMouseMove:function(a){this.infoTip.setAttribute("multiline",false);this.showInfoTip(this.infoTip,a.target,a.clientX,a.clientY,a.rangeParent,a.rangeOffset)},populateTimingInfoTip:function(a,c){this.tags.colorTag.replace({rgbValue:c},a);return true}, -addListener:function(a){this.listeners.push(a)},removeListener:function(a){b.remove(this.listeners,a)}});e.initialize();return e}}); +require.def("domplate/infoTip",["domplate/domplate","core/lib","core/trace"],function(Domplate,Lib,Trace){with(Domplate){var InfoTip=Lib.extend({listeners:[],maxWidth:100,maxHeight:80,infoTipMargin:10,infoTipWindowPadding:25,tags:domplate({infoTipTag:DIV({"class":"infoTip"})}),initialize:function(){if(!$.browser.msie){var a=$("body");a.bind("mouseover",Lib.bind(this.onMouseMove,this)),a.bind("mouseout",Lib.bind(this.onMouseOut,this)),a.bind("mousemove",Lib.bind(this.onMouseMove,this));return this.infoTip=this.tags.infoTipTag.append({},Lib.getBody(document))}},showInfoTip:function(a,b,c,d,e,f){var g=Lib.getOverflowParent(b),h=c+(g?g.scrollLeft:0),i=Lib.dispatch2(this.listeners,"showInfoTip",[a,b,h,d,e,f]);if(i){var j=a.ownerDocument.documentElement,k=j.clientWidth,l=j.clientHeight;c+a.offsetWidth+this.infoTipMargin>k-this.infoTipWindowPadding?(a.style.left="auto",a.style.right=k-c+this.infoTipMargin+"px"):(a.style.left=c+this.infoTipMargin+"px",a.style.right="auto"),d+a.offsetHeight+this.infoTipMargin>l?(a.style.top=Math.max(0,l-(a.offsetHeight+this.infoTipMargin))+"px",a.style.bottom="auto"):(a.style.top=d+this.infoTipMargin+"px",a.style.bottom="auto"),a.setAttribute("active","true")}else this.hideInfoTip(a)},hideInfoTip:function(a){a&&a.removeAttribute("active")},onMouseOut:function(a){a.relatedTarget||this.hideInfoTip(this.infoTip)},onMouseMove:function(a){this.infoTip.setAttribute("multiline",!1);var b=a.clientX,c=a.clientY;this.showInfoTip(this.infoTip,a.target,b,c,a.rangeParent,a.rangeOffset)},populateTimingInfoTip:function(a,b){this.tags.colorTag.replace({rgbValue:b},a);return!0},addListener:function(a){this.listeners.push(a)},removeListener:function(a){Lib.remove(this.listeners,a)}});InfoTip.initialize();return InfoTip}}) \ No newline at end of file