aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-07-10 18:55:06 +0000
committerOlivier Lamy <olamy@apache.org>2012-07-10 18:55:06 +0000
commitf7f824b1b25823dc8041312b1b3d356b40968aa1 (patch)
tree0438e34c7224d35978bdb2bbef2b651608b05fdf /archiva-modules
parent497c858bdc14db801b064f9a052627ea8523c3be (diff)
downloadarchiva-f7f824b1b25823dc8041312b1b3d356b40968aa1.tar.gz
archiva-f7f824b1b25823dc8041312b1b3d356b40968aa1.zip
handle browsing via sammy so history works
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1359837 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js18
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js2
2 files changed, 11 insertions, 9 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
index 3a8596680..1d4bb9d8e 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
@@ -65,12 +65,6 @@ function() {
return;
}
- var browse = $.urlParam('browse');
- if (browse){
- displayBrowseGroupId(browse);
- return;
- }
-
var artifact= $.urlParam("artifact");
var repositoryId = $.urlParam("repositoryId");
// format groupId:artifactId org.apache.maven.plugins:maven-jar-plugin
@@ -262,15 +256,23 @@ function() {
this.activeMenuId = ko.observable();
window.sammyArchivaApplication = Sammy(function () {
+ this.get('#browse/:groupId',function(context){
+ var groupId = this.params['groupId'];
+ if (groupId){
+ displayBrowseGroupId(groupId);
+ } else {
+ displayBrowse(true);
+ }
+ });
this.get('#:folder', function () {
self.activeMenuId(this.params.folder);
ko.utils.arrayFirst(self.artifactMenuItems.concat(self.usersMenuItems, self.administrationMenuItems), function(p) {
if ( p.href == "#"+self.activeMenuId()) {
- p.func();
+ p.func();
}
});
- });
+ });
this.get('', function () { this.app.runRoute('get', '#Search') });
} );
sammyArchivaApplication.run();
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
index ca50e040d..bbc4ba4e0 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
@@ -29,7 +29,7 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
this.parentBrowseViewModel=parentBrowseViewModel;
this.groupId=groupId;
displayGroupId=function(groupId){
- displayGroupDetail(groupId,self);
+ window.sammyArchivaApplication.setLocation("#browse/"+groupId);
}
displayParentGroupId=function(){
$.log("called displayParentGroupId groupId:"+self.parentBrowseViewModel.groupId);