Marcin Kuzminski avatar Marcin Kuzminski committed 9812e61

fix files quick filter links

Comments (0)

Files changed (2)

rhodecode/public/js/rhodecode.js

 }
 
 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){
 	  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');
 	                    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']));

rhodecode/templates/files/files.html

 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){
 
         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,
     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);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.