changeset 2891:9812e617c564 beta

fix files quick filter links
author Marcin Kuzminski <marcin@python-works.com>
date Tue, 02 Oct 2012 23:24:41 +0200
parents 84414d73c233
children 5fba3778431c
files rhodecode/public/js/rhodecode.js rhodecode/templates/files/files.html
diffstat 2 files changed, 9 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/public/js/rhodecode.js	Tue Oct 02 21:32:00 2012 +0200
+++ b/rhodecode/public/js/rhodecode.js	Tue Oct 02 23:24:41 2012 +0200
@@ -673,10 +673,7 @@
 }
 
 var fileBrowserListeners = function(current_url, node_list_url, url_base){
-	
 	var current_url_branch = +"?branch=__BRANCH__";
-	var url = url_base;
-	var node_url = node_list_url;	
 
 	YUE.on('stay_at_branch','click',function(e){
 	    if(e.target.checked){
@@ -700,7 +697,7 @@
 	  YUD.setStyle('search_activate_id','display','none');
 	  YUD.setStyle('add_node_id','display','none');
 	  YUC.initHeader('X-PARTIAL-XHR',true);
-	  YUC.asyncRequest('GET',url,{
+	  YUC.asyncRequest('GET', node_list_url, {
 	      success:function(o){
 	        nodes = JSON.parse(o.responseText).nodes;
 	        YUD.setStyle('node_filter_box_loading','display','none');
@@ -743,8 +740,8 @@
 	                    var n_hl = n.substring(0,pos)
 	                      +"<b>{0}</b>".format(n.substring(pos,pos+query.length))
 	                      +n.substring(pos+query.length)
-	                    node_url = node_url.replace('__FPATH__',n);
-	                    match.push('<tr><td><a class="browser-{0}" href="{1}">{2}</a></td><td colspan="5"></td></tr>'.format(t,node_url,n_hl));
+	                    var new_url = url_base.replace('__FPATH__',n);
+	                    match.push('<tr><td><a class="browser-{0}" href="{1}">{2}</a></td><td colspan="5"></td></tr>'.format(t,new_url,n_hl));
 	                }
 	                if(match.length >= matches_max){
 	                    match.push('<tr><td>{0}</td><td colspan="5"></td></tr>'.format(_TM['search truncated']));
--- a/rhodecode/templates/files/files.html	Tue Oct 02 21:32:00 2012 +0200
+++ b/rhodecode/templates/files/files.html	Tue Oct 02 23:24:41 2012 +0200
@@ -41,9 +41,9 @@
 var CACHE = {};
 var CACHE_EXPIRE = 60*1000; //cache for 60s
 //used to construct links from the search list
-var node_list_url = '${h.url("files_home",repo_name=c.repo_name,revision='__REV__',f_path='__FPATH__')}';
+var url_base = '${h.url("files_home",repo_name=c.repo_name,revision='__REV__',f_path='__FPATH__')}';
 //send the nodelist request to this url
-var url_base = '${h.url("files_nodelist_home",repo_name=c.repo_name,revision='__REV__',f_path='__FPATH__')}';
+var node_list_url = '${h.url("files_nodelist_home",repo_name=c.repo_name,revision='__REV__',f_path='__FPATH__')}';
 
 var ypjax_links = function(){
     YUE.on(YUQ('.ypjax-link'), 'click',function(e){
@@ -71,8 +71,8 @@
 
         var title = "${_('%s files') % c.repo_name}" + " - " + f_path;
 
-        var _node_list_url = node_list_url.replace('__REV__',rev);
-        var _url_base = url_base.replace('__REV__',rev).replace('__FPATH__', f_path);
+        var _node_list_url = node_list_url.replace('__REV__',rev).replace('__FPATH__', f_path);
+        var _url_base = url_base.replace('__REV__',rev);
 
         // Change our States and save some data for handling events
         var data = {url:url,title:title, url_base:_url_base,
@@ -132,8 +132,8 @@
     var _State = {
        url: "${h.url.current()}",
        data: {
-         node_list_url: node_list_url.replace('__REV__',"${c.changeset.raw_id}"),
-         url_base: url_base.replace('__REV__',"${c.changeset.raw_id}").replace('__FPATH__', "${h.safe_unicode(c.file.path)}")
+         node_list_url: node_list_url.replace('__REV__',"${c.changeset.raw_id}").replace('__FPATH__', "${h.safe_unicode(c.file.path)}"),
+         url_base: url_base.replace('__REV__',"${c.changeset.raw_id}")
        }
     }
     fileBrowserListeners(_State.url, _State.data.node_list_url, _State.data.url_base);