mirror of https://github.com/apache/archiva.git
correctly handle current groupId browsing when changing repositoryId.
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1366909 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0985ccf02a
commit
01e276a590
|
@ -694,7 +694,13 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
|
|||
|
||||
changeBrowseRepository=function(){
|
||||
var selectedRepository=getSelectedBrowsingRepository();
|
||||
window.sammyArchivaApplication.setLocation("#browse~"+selectedRepository);
|
||||
// #browse~internal/org.apache.maven
|
||||
var currentHash=window.location.hash;
|
||||
var newLocation = "#browse~"+selectedRepository+currentHash.substringAfterFirst("/");
|
||||
// do we have extra path after repository ?
|
||||
|
||||
$.log("changeBrowseRepository:"+newLocation);
|
||||
window.sammyArchivaApplication.setLocation(newLocation);
|
||||
}
|
||||
|
||||
getSelectedBrowsingRepository=function(){
|
||||
|
|
|
@ -405,6 +405,18 @@ define("utils",["jquery","i18n","jquery.tmpl"], function() {
|
|||
String.prototype.substringAfterLast = function(str) {
|
||||
return this.substring(this.lastIndexOf(str)+1);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param str
|
||||
* @return {String} if str not found return empty string
|
||||
*/
|
||||
String.prototype.substringAfterFirst = function(str) {
|
||||
var idx = this.indexOf(str);
|
||||
if (idx<0){
|
||||
return "";
|
||||
}
|
||||
return this.substring(idx);
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// extends jquery tmpl to support var def
|
||||
|
|
Loading…
Reference in New Issue