diff options
author | Olivier Lamy <olamy@apache.org> | 2013-12-02 04:46:05 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2013-12-02 04:46:05 +0000 |
commit | 69f81f309d896db6e627e23ce4f0d91f0f90fd7d (patch) | |
tree | 5040e909e78d49ffed2bc5c6f25dc8b70a41bfd9 /archiva-modules | |
parent | 60b382e36e53e37d966fe79db62618fd34d9c5e1 (diff) | |
download | archiva-69f81f309d896db6e627e23ce4f0d91f0f90fd7d.tar.gz archiva-69f81f309d896db6e627e23ce4f0d91f0f90fd7d.zip |
[MRM-1766] Clicking the ".." when browsing should take you up one level in the group chain and not "Home"
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1546895 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r-- | archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/search.js | 12 | ||||
-rw-r--r-- | archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/search.html | 4 |
2 files changed, 10 insertions, 6 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/search.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/search.js index 1ac595b07..da01206d9 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/search.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/search.js @@ -25,6 +25,7 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","select2","knockout","kno //----------------------------------------- BrowseViewModel=function(browseResultEntries,parentBrowseViewModel,groupId,repositoryId,feedsUrl){ + $.log("BrowseViewModel:"+repositoryId); var self=this; this.browseResultEntries=browseResultEntries; this.parentBrowseViewModel=parentBrowseViewModel; @@ -41,9 +42,12 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","select2","knockout","kno } displayParentGroupId=function(){ $.log("called displayParentGroupId groupId:"+self.parentBrowseViewModel.groupId); + // if null parent is root level - if (self.parentBrowseViewModel.groupId){ - displayGroupDetail(self.parentBrowseViewModel.groupId,self.parentBrowseViewModel); + if (self.parentBrowseViewModel.groupId && self.parentBrowseViewModel.groupId.indexOf(".")>=1){ + // remove last part of the groupId + window.sammyArchivaApplication.setLocation("#browse/"+groupId.substringBeforeLast('.')); + //displayGroupDetail(self.parentBrowseViewModel.groupId,self.parentBrowseViewModel); } else { browseRoot(); } @@ -1203,7 +1207,7 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","select2","knockout","kno var mainContent = $("#main-content"); mainContent.html($("#browse-tmpl" ).tmpl()); mainContent.find("#browse_result").html(mediumSpinnerImg()); - var parentBrowseViewModel=new BrowseViewModel(null,null,null,repositoryId); + var parentBrowseViewModel=new BrowseViewModel(null,null,groupId,repositoryId); var url="restServices/archivaServices/browseService/browseGroupId/"+encodeURIComponent(groupId); var feedsUrl=applicationUrl?applicationUrl:window.location.toString().substringBeforeLast("/").substringBeforeLast("/"); if (repositoryId){ @@ -1532,7 +1536,7 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","select2","knockout","kno clearUserMessages(); var mainContent = $("#main-content"); mainContent.find("#browse_result").html(mediumSpinnerImg()); - var parentBrowseViewModel=new BrowseViewModel(null,null,null); + var parentBrowseViewModel=new BrowseViewModel(null,null,groupId); displayGroupDetail(groupId,parentBrowseViewModel,null); } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/search.html b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/search.html index 6c48a3e29..db22cc012 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/search.html +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/search.html @@ -45,8 +45,8 @@ <!-- if null we are on root level --> {{if $root.parentBrowseViewModel}} - <li class="browse-list" data-bind="click:function(){displayParentGroupId()}"> - <a href="#">..</a> + <li class="browse-list"> + <a data-bind="click:function(){displayParentGroupId()}" href="#">.. foo</a> </li> {{/if}} {{each(i,browseResultEntry) browseResultEntries}} |