Changeset - 8cca07df79dd
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 15 years ago 2011-05-08 20:11:26
marcin@python-works.com
fixed small bug in selection links when sorting messes up for <10 numbers
1 file changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/templates/files/files_source.html
Show inline comments
 
@@ -123,32 +123,33 @@ YUE.onDOMReady(function(){
 
        if (typeof window.getSelection != "undefined") {
 
        	s = window.getSelection();
 

	
 
           	from = getIdentNode(s.anchorNode);
 
           	till = getIdentNode(s.focusNode);
 
            
 
            f_int = parseInt(from.id.replace('L',''));
 
            t_int = parseInt(till.id.replace('L',''));
 
            
 
            if (f_int > t_int){
 
            	//highlight from bottom 
 
            	offset = -35;
 
            	ranges = [t_int,f_int];
 
            	
 
            }
 
            else{
 
            	//highligth from top 
 
            	offset = 35;
 
            	ranges = [f_int,t_int];
 
            }
 
            
 
            ranges = [f_int,t_int].sort();
 
            
 
            if (ranges[0] != ranges[1]){
 
	            if(YUD.get('linktt') == null){
 
	                hl_div = document.createElement('div');
 
	                hl_div.id = 'linktt';
 
	            }
 
	            anchor = '#L'+ranges[0]+'-'+ranges[1];
 
	            hl_div.innerHTML = '';
 
	            l = document.createElement('a');
 
	            l.href = location.href.substring(0,location.href.indexOf('#'))+anchor;
 
	            l.innerHTML = "${_('Selection link')}"
 
	            hl_div.appendChild(l);
 
	            
0 comments (0 inline, 0 general)