mirror of https://github.com/apache/archiva.git
fix hash when changing repository
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1370415 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e12e0e6f50
commit
ae610b03b7
|
@ -756,8 +756,14 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
|
|||
changeBrowseRepository=function(){
|
||||
var selectedRepository=getSelectedBrowsingRepository();
|
||||
// #browse~internal/org.apache.maven
|
||||
// or #artifact~snapshots/org.apache.maven.plugins/maven-compiler-plugin
|
||||
var currentHash=window.location.hash;
|
||||
var newLocation = "#browse";
|
||||
|
||||
|
||||
|
||||
$.log("currentHash:"+currentHash);
|
||||
|
||||
var newLocation = currentHash.substringBeforeFirst("/");// "#browse";
|
||||
if (selectedRepository){
|
||||
newLocation+="~"+selectedRepository;
|
||||
}
|
||||
|
|
|
@ -402,6 +402,14 @@ define("utils",["jquery","i18n","jquery.tmpl"], function() {
|
|||
return this.substring(0,this.lastIndexOf(str));
|
||||
}
|
||||
|
||||
String.prototype.substringBeforeFirst = function(str) {
|
||||
var idx = this.indexOf(str);
|
||||
if(idx<0){
|
||||
return this;
|
||||
}
|
||||
return this.substring(0,idx);
|
||||
}
|
||||
|
||||
String.prototype.substringAfterLast = function(str) {
|
||||
return this.substring(this.lastIndexOf(str)+1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue