]> source.dussan.org Git - archiva.git/commitdiff
jquery selector optims
authorOlivier Lamy <olamy@apache.org>
Fri, 24 Aug 2012 10:04:30 +0000 (10:04 +0000)
committerOlivier Lamy <olamy@apache.org>
Fri, 24 Aug 2012 10:04:30 +0000 (10:04 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1376881 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/artifacts-management.js

index aad69645a4476943ef15b7b4b821b18e6e5576e0..0f3169fb08d06f85c935e9f1cb8dd3c29e8b10f2 100644 (file)
@@ -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){