From e771739ee822171805d839ef720be84b01081116 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Sat, 6 Oct 2012 15:12:26 +0000 Subject: [PATCH] reuse jquery selectors git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1395091 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/js/archiva/docs.js | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/docs.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/docs.js index 6acdf1205..8ecd44021 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/docs.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/docs.js @@ -25,42 +25,45 @@ define("archiva.docs",["jquery","i18n","jquery.tmpl","bootstrap"], function() { } goToArchivaRestDoc=function(target){ - $("#main-content" ).find("#rest_docs_content" ).html(mediumSpinnerImg()); + var mainContent = $("#main-content"); + mainContent.find("#rest_docs_content" ).html(mediumSpinnerImg()); $.ajax({ url:"rest-docs/rest-docs-archiva-rest-api/"+target, type:"get", dataType: "html", success: function(data){ - $("#main-content" ).html($("#rest_docs").tmpl()); - $("#main-content" ).find("#rest_docs_content" ).html(data); + mainContent.html($("#rest_docs").tmpl()); + mainContent.find("#rest_docs_content" ).html(data); prettyPrint(); } }); } goToArchivaRestUiDoc=function(target){ - $("#main-content" ).find("#rest_docs_content" ).html(mediumSpinnerImg()); + var mainContent = $("#main-content"); + mainContent.find("#rest_docs_content" ).html(mediumSpinnerImg()); $.ajax({ url:"rest-docs/rest-docs-archiva-ui/"+target, type:"get", dataType: "html", success: function(data){ - $("#main-content" ).html($("#rest_docs").tmpl()); - $("#main-content" ).find("#rest_docs_content" ).html(data); + mainContent.html($("#rest_docs").tmpl()); + mainContent.find("#rest_docs_content" ).html(data); prettyPrint(); } }); } goToRedbackRestDoc=function(target){ - $("#main-content" ).find("#rest_docs_content" ).html(mediumSpinnerImg()); + var mainContent = $("#main-content"); + mainContent.find("#rest_docs_content" ).html(mediumSpinnerImg()); $.ajax({ url:"rest-docs/rest-docs-redback-rest-api/"+target, type:"get", dataType: "html", success: function(data){ - $("#main-content" ).html($("#rest_docs").tmpl()); - $("#main-content" ).find("#rest_docs_content" ).html(data); + mainContent.html($("#rest_docs").tmpl()); + mainContent.find("#rest_docs_content" ).html(data); prettyPrint(); } }); -- 2.39.5