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
 
@@ -110,38 +110,66 @@ class _ToolTip(object):
 
                autodismissdelay:300000,
 
                hidedelay:5,
 
                showdelay:20,
 
            });
 
            
 
            //Mouse Over event disabled for new repositories since they dont
 
            //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()
 

	
 
class _FilesBreadCrumbs(object):
 
    
 
    def __call__(self, repo_name, rev, paths):
 
        url_l = [link_to(repo_name, url('files_home', repo_name=repo_name, revision=rev, f_path=''))]
 
        paths_l = paths.split(' / ')
 
        
0 comments (0 inline, 0 general)