Changeset - 36b18edeca48
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2012-12-19 00:29:38
marcin@python-works.com
fixes #687 Lazy loaded tooltip bug with simultaneous ajax requests
1 file changed with 2 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/public/js/rhodecode.js
Show inline comments
 
@@ -407,25 +407,24 @@ YAHOO.yuitip.main = {
 
	useAnim:	false,
 
	maxWidth:	600,
 
	add_links:	false,
 
	yuitips:    [],
 

	
 
	set_listeners: function(tt){
 
		YUE.on(tt, 'mouseover', yt.show_yuitip,  tt);
 
		YUE.on(tt, 'mousemove', yt.move_yuitip,  tt);
 
		YUE.on(tt, 'mouseout',  yt.close_yuitip, tt);		
 
	},
 

	
 
	init: function(){
 
		yt._tooltip = '';
 
		yt.tipBox = yt.$('tip-box');
 
		if(!yt.tipBox){
 
			yt.tipBox = document.createElement('div');
 
			document.body.appendChild(yt.tipBox);
 
			yt.tipBox.id = 'tip-box';
 
		}
 

	
 
		YUD.setStyle(yt.tipBox, 'display', 'none');
 
		YUD.setStyle(yt.tipBox, 'position', 'absolute');
 
		if(yt.maxWidth !== null){
 
			YUD.setStyle(yt.tipBox, 'max-width', yt.maxWidth+'px');
 
		}
 
@@ -448,25 +447,25 @@ YAHOO.yuitip.main = {
 
	},
 

	
 
	show_yuitip: function(e, el){
 
		YUE.stopEvent(e);
 
		if(el.tagName.toLowerCase() === 'img'){
 
			yt.tipText = el.alt ? el.alt : '';
 
		} else {
 
			yt.tipText = el.title ? el.title : '';
 
		}
 

	
 
		if(yt.tipText !== ''){
 
			// save org title
 
			yt._tooltip = yt.tipText;
 
			YUD.setAttribute(el, 'tt_title', yt.tipText);
 
			// reset title to not show org tooltips
 
			YUD.setAttribute(el, 'title', '');
 

	
 
			yt.tipBox.innerHTML = yt.tipText;
 
			YUD.setStyle(yt.tipBox, 'display', 'block');
 
			if(yt.useAnim === true){
 
				YUD.setStyle(yt.tipBox, 'opacity', '0');
 
				var newAnim = new YAHOO.util.Anim(yt.tipBox,
 
					{
 
						opacity: { to: yt.opacity }
 
					}, yt.speed, YAHOO.util.Easing.easeOut
 
				);
 
@@ -486,25 +485,25 @@ YAHOO.yuitip.main = {
 
		YUE.stopEvent(e);
 
	
 
		if(yt.useAnim === true){
 
			var newAnim = new YAHOO.util.Anim(yt.tipBox,
 
				{
 
					opacity: { to: 0 }
 
				}, yt.speed, YAHOO.util.Easing.easeOut
 
			);
 
			newAnim.animate();
 
		} else {
 
			YUD.setStyle(yt.tipBox, 'display', 'none');
 
		}
 
		YUD.setAttribute(el,'title', yt._tooltip);
 
		YUD.setAttribute(el,'title', YUD.getAttribute(el, 'tt_title'));
 
	}
 
}
 

	
 
/**
 
 * Quick filter widget
 
 * 
 
 * @param target: filter input target
 
 * @param nodes: list of nodes in html we want to filter.
 
 * @param display_element function that takes current node from nodes and
 
 *    does hide or show based on the node
 
 * 
 
 */
0 comments (0 inline, 0 general)