From 18f535b8da02addd743d26fcd15e1ab2c94ecffb Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 24 Aug 2012 10:04:30 +0000 Subject: [PATCH] jquery selector optims git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1376881 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/js/archiva/artifacts-management.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/artifacts-management.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/artifacts-management.js index aad69645a..0f3169fb0 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/artifacts-management.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/artifacts-management.js @@ -39,7 +39,7 @@ define("archiva.artifacts-management",["jquery","i18n","utils","jquery.tmpl","kn saveArtifacts=function(){ clearUserMessages(); - if(!$("#main-content #fileupload" ).valid()){ + if(!$("#main-content" ).find("#fileupload" ).valid()){ return; } if(this.artifactUploads.length<1){ @@ -84,12 +84,14 @@ define("archiva.artifacts-management",["jquery","i18n","utils","jquery.tmpl","kn success: function(data) { var artifactUploadViewModel=new ArtifactUploadViewModel(data); ko.applyBindings(artifactUploadViewModel,mainContent.find("#file-upload-main" ).get(0)); - var validator = $("#main-content #fileupload" ).validate({ + var fileUpload=$("#main-content" ).find("#fileupload"); + var validator = fileUpload.validate({ showErrors: function(validator, errorMap, errorList) { customShowError("#main-content #fileupload",validator,errorMap,errorMap); } }); - $('#fileupload').fileupload({ + + fileUpload.fileupload({ submit: function (e, data) { var $this = $(this); $this.fileupload('send', data); @@ -98,7 +100,7 @@ define("archiva.artifacts-management",["jquery","i18n","utils","jquery.tmpl","kn } } ); - $('#fileupload').bind('fileuploadsubmit', function (e, data) { + fileUpload.bind('fileuploadsubmit', function (e, data) { var pomFile = data.context.find('#pomFile' ).attr("checked"); var classifier = data.context.find('#classifier' ).val(); if (!data.formData){