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 b927169d4..f4eb806de 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 @@ -295,11 +295,10 @@ define("search",["jquery","i18n","jquery.tmpl","choosen","order!knockout","knock url: pomContentUrl, dataType: "text", success: function(data) { - $.log("foo"); - $.log("data:"+data); var text = data.replace(//g,">"); mainContent.find("#artifact-content-text" ).html(text); + goToAnchor("artifact-content-text-header"); } }); return; @@ -334,6 +333,7 @@ define("search",["jquery","i18n","jquery.tmpl","choosen","order!knockout","knock var text = data.replace(//g,">"); mainContent.find("#artifact-content-text" ).html(text); + goToAnchor("artifact-content-text-header"); } }); } diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js index 69a575e36..605b7a5fd 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js @@ -373,6 +373,12 @@ define("utils",["jquery","i18n","jquery.tmpl"], function() { return sorted?res.sort():res; } + goToAnchor=function(anchor){ + var curHref = window.location.href; + curHref=curHref.substringBeforeLast("#"); + window.location.href=curHref+"#"+anchor; + } + //------------------------------------ // utils javascript string extensions //------------------------------------ diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html index 544b90155..a44be1ca8 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html @@ -823,8 +823,8 @@ -

Content

+

Content

-

+         
\ No newline at end of file