Changeset - 6603c9891b91
[Not reviewed]
default
0 1 0
Marcin Kuzminski - 15 years ago 2010-06-22 21:24:22
marcin@python-works.com
tooltip display bugfix
1 file changed with 28 insertions and 0 deletions:
0 comments (0 inline, 0 general)
pylons_app/lib/helpers.py
Show inline comments
 
@@ -116,26 +116,54 @@ class _ToolTip(object):
 
            //have last commit message
 
            myToolTips.contextMouseOverEvent.subscribe(
 
                function(type, args) {
 
                    var context = args[0];
 
                    var txt = context.getAttribute('tooltip_title');
 
                    if(txt){
 
                        this.cfg.config.x.value = 0;
 
                        this.cfg.config.y.value = 0;
 
                                        
 
                        return true;
 
                    }
 
                    else{
 
                        return false;
 
                    }
 
                });
 
            
 
                            
 
            // Set the text for the tooltip just before we display it. Lazy method
 
            myToolTips.contextTriggerEvent.subscribe( 
 
                 function(type, args) { 
 
                        var context = args[0]; 
 
                        var txt = context.getAttribute('tooltip_title');
 
                        this.cfg.setProperty("text", txt);                     
 
                        //autocenter
 
                        var w = this.element.clientWidth;
 
                        var h = this.element.clientHeight;
 
                        var cur_x = this.pageX - (w / 2);
 
                        var cur_y = this.pageY - h - 10;
 

	
 
                        this.cfg.setProperty("xy",[cur_x,cur_y]);
 

	
 
                  });
 
            //Mouse out 
 
            myToolTips.contextMouseOutEvent.subscribe(
 
                function(type, args) {
 
                    var context = args[0];
 
                    
 
                    //console.log(this.cfg.config.x.value);
 
                    //console.log(this.cfg.config.y.value);
 
                    //console.log(this.cfg.config.xy.value);
 
                    //console.log(this.cfg.config);
 
                    //this.cfg.config.xy = [0,0];
 
                    //this.cfg.config.xyoffset = [0,0];
 
                    
 
                    
 
                    
 
                });
 
                                  
 
        });
 
        '''         
 
        return literal(js)
 

	
 
tooltip = _ToolTip()
 

	
0 comments (0 inline, 0 general)