From 888aaddb53583a0c7b3e25c9caf3864220765f66 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 3 Feb 2012 18:25:11 +0000 Subject: [PATCH] some jquery optims git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1240283 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/js/archiva/utils.js | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) 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 ccf12113b..0067cc4fd 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 @@ -105,10 +105,10 @@ clearUserMessages=function(idToAppend){ * @param selectorStr */ clearForm=function(selectorStr){ - $(selectorStr+" input[type='text']").each(function(ele){ + $(selectorStr).find("input[type='text']").each(function(ele){ $(this).val(""); }); - $(selectorStr+" input[type='password']").each(function(ele){ + $(selectorStr).find("input[type='password']").each(function(ele){ $(this).val(""); }); @@ -217,13 +217,6 @@ mapStringArray=function(data){ return null; } -// extends jquery tmpl to support var def -$.extend($.tmpl.tag, { - "var": { - open: "var $1;" - } -}); - /** * display redback error from redback json error response * {"redbackRestError":{"errorMessages":{"args":1,"errorKey":"user.password.violation.numeric"}}} @@ -291,8 +284,8 @@ displayRestError=function(data,idToAppend){ * @param errorList */ customShowError=function(selector, validator, errorMap, errorList) { - $( selector+" div.control-group" ).removeClass( "error" ); - $( selector+" span.help-inline" ).remove(); + $(selector ).find("div.control-group" ).removeClass( "error" ); + $(selector).find("span.help-inline").remove(); for ( var i = 0; errorList[i]; i++ ) { var error = errorList[i]; var field = $("#"+error.element.id); @@ -310,4 +303,12 @@ timestampNoCache=function(){ appendTemplateUrl=function(){ return "?"+appendArchivaVersion()+timestampNoCache(); -} \ No newline at end of file +} + + +// extends jquery tmpl to support var def +$.extend($.tmpl.tag, { + "var": { + open: "var $1;" + } +}); \ No newline at end of file -- 2.39.5