##// END OF EJS Templates
tooltip display bugfix
marcink -
r286:6603c989 default
parent child Browse files
Show More
@@ -119,6 +119,9 class _ToolTip(object):
119 119 var context = args[0];
120 120 var txt = context.getAttribute('tooltip_title');
121 121 if(txt){
122 this.cfg.config.x.value = 0;
123 this.cfg.config.y.value = 0;
124
122 125 return true;
123 126 }
124 127 else{
@@ -126,13 +129,38 class _ToolTip(object):
126 129 }
127 130 });
128 131
132
129 133 // Set the text for the tooltip just before we display it. Lazy method
130 134 myToolTips.contextTriggerEvent.subscribe(
131 135 function(type, args) {
132 136 var context = args[0];
133 137 var txt = context.getAttribute('tooltip_title');
134 this.cfg.setProperty("text", txt);
138 this.cfg.setProperty("text", txt);
139 //autocenter
140 var w = this.element.clientWidth;
141 var h = this.element.clientHeight;
142 var cur_x = this.pageX - (w / 2);
143 var cur_y = this.pageY - h - 10;
144
145 this.cfg.setProperty("xy",[cur_x,cur_y]);
146
135 147 });
148 //Mouse out
149 myToolTips.contextMouseOutEvent.subscribe(
150 function(type, args) {
151 var context = args[0];
152
153 //console.log(this.cfg.config.x.value);
154 //console.log(this.cfg.config.y.value);
155 //console.log(this.cfg.config.xy.value);
156 //console.log(this.cfg.config);
157 //this.cfg.config.xy = [0,0];
158 //this.cfg.config.xyoffset = [0,0];
159
160
161
162 });
163
136 164 });
137 165 '''
138 166 return literal(js)
General Comments 0
You need to be logged in to leave comments. Login now