Author: olamy
Date: Tue Aug 7 18:13:32 2012
New Revision: 1370414
URL: http://svn.apache.org/viewvc?rev=1370414&view=rev
Log:
fix issue in hash calculation when changing repository while browsing
Modified:
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
Modified:
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
URL:
http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js?rev=1370414&r1=1370413&r2=1370414&view=diff
==============================================================================
---
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
(original)
+++
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
Tue Aug 7 18:13:32 2012
@@ -61,11 +61,16 @@ define("archiva.search",["jquery","i18n"
// artifactId can contains .
// value org.apache.aries/org.apache.aries.util
// split this org.apache.maven and maven-archiver
- var values =
id.substring((self.groupId+'.').length,id.length);//.split(".");
-
$.log("displayProjectEntry:"+id+",groupId:"+self.groupId+",values:"+values);
+ var artifactId =
id.substring((self.groupId+'.').length,id.length);//.split(".");
+ var selectedRepo=getSelectedBrowsingRepository();
- displayArtifactDetail(self.groupId,values,self);
-
//window.sammyArchivaApplication.setLocation("#artifact/"+self.groupId+"/"+values);
+ var location ="#artifact";
+ if (selectedRepo){
+ location+="~"+selectedRepo;
+ }
+ location+="/"+self.groupId+"/"+artifactId;
+
+ window.sammyArchivaApplication.setLocation(location);
}
@@ -752,7 +757,11 @@ define("archiva.search",["jquery","i18n"
var selectedRepository=getSelectedBrowsingRepository();
// #browse~internal/org.apache.maven
var currentHash=window.location.hash;
- var newLocation =
"#browse~"+selectedRepository+currentHash.substringAfterFirst("/");
+ var newLocation = "#browse";
+ if (selectedRepository){
+ newLocation+="~"+selectedRepository;
+ }
+ newLocation += currentHash.substringAfterFirst("/");
// do we have extra path after repository ?
$.log("changeBrowseRepository:"+newLocation);