##// END OF EJS Templates
fixed problem with tooltips flickering.
marcink -
r1187:08d77411 beta
parent child Browse files
Show More
@@ -116,7 +116,7 b' class _ToolTip(object):'
116 return ids
116 return ids
117 };
117 };
118 var myToolTips = new YAHOO.widget.Tooltip("tooltip", {
118 var myToolTips = new YAHOO.widget.Tooltip("tooltip", {
119 context: toolTipsId(),
119 context: [[toolTipsId()],"tl","bl",null,[0,5]],
120 monitorresize:false,
120 monitorresize:false,
121 xyoffset :[0,0],
121 xyoffset :[0,0],
122 autodismissdelay:300000,
122 autodismissdelay:300000,
@@ -124,64 +124,6 b' class _ToolTip(object):'
124 showdelay:20,
124 showdelay:20,
125 });
125 });
126
126
127 // Set the text for the tooltip just before we display it. Lazy method
128 myToolTips.contextTriggerEvent.subscribe(
129 function(type, args) {
130
131 var context = args[0];
132
133 //positioning of tooltip
134 var tt_w = this.element.clientWidth;//tooltip width
135 var tt_h = this.element.clientHeight;//tooltip height
136
137 var context_w = context.offsetWidth;
138 var context_h = context.offsetHeight;
139
140 var pos_x = YAHOO.util.Dom.getX(context);
141 var pos_y = YAHOO.util.Dom.getY(context);
142
143 var display_strategy = 'right';
144 var xy_pos = [0,0];
145 switch (display_strategy){
146
147 case 'top':
148 var cur_x = (pos_x+context_w/2)-(tt_w/2);
149 var cur_y = (pos_y-tt_h-4);
150 xy_pos = [cur_x,cur_y];
151 break;
152 case 'bottom':
153 var cur_x = (pos_x+context_w/2)-(tt_w/2);
154 var cur_y = pos_y+context_h+4;
155 xy_pos = [cur_x,cur_y];
156 break;
157 case 'left':
158 var cur_x = (pos_x-tt_w-4);
159 var cur_y = pos_y-((tt_h/2)-context_h/2);
160 xy_pos = [cur_x,cur_y];
161 break;
162 case 'right':
163 var cur_x = (pos_x+context_w+4);
164 var cur_y = pos_y-((tt_h/2)-context_h/2);
165 xy_pos = [cur_x,cur_y];
166 break;
167 default:
168 var cur_x = (pos_x+context_w/2)-(tt_w/2);
169 var cur_y = pos_y-tt_h-4;
170 xy_pos = [cur_x,cur_y];
171 break;
172
173 }
174
175 this.cfg.setProperty("xy",xy_pos);
176
177 });
178
179 //Mouse out
180 myToolTips.contextMouseOutEvent.subscribe(
181 function(type, args) {
182 var context = args[0];
183
184 });
185 });
127 });
186 '''
128 '''
187 return literal(js)
129 return literal(js)
General Comments 0
You need to be logged in to leave comments. Login now