jquery selector optims

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1376881 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-08-24 10:04:30 +00:00
parent b4f0e806cb
commit 18f535b8da
1 changed files with 6 additions and 4 deletions

View File

@ -39,7 +39,7 @@ define("archiva.artifacts-management",["jquery","i18n","utils","jquery.tmpl","kn
saveArtifacts=function(){ saveArtifacts=function(){
clearUserMessages(); clearUserMessages();
if(!$("#main-content #fileupload" ).valid()){ if(!$("#main-content" ).find("#fileupload" ).valid()){
return; return;
} }
if(this.artifactUploads.length<1){ if(this.artifactUploads.length<1){
@ -84,12 +84,14 @@ define("archiva.artifacts-management",["jquery","i18n","utils","jquery.tmpl","kn
success: function(data) { success: function(data) {
var artifactUploadViewModel=new ArtifactUploadViewModel(data); var artifactUploadViewModel=new ArtifactUploadViewModel(data);
ko.applyBindings(artifactUploadViewModel,mainContent.find("#file-upload-main" ).get(0)); 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) { showErrors: function(validator, errorMap, errorList) {
customShowError("#main-content #fileupload",validator,errorMap,errorMap); customShowError("#main-content #fileupload",validator,errorMap,errorMap);
} }
}); });
$('#fileupload').fileupload({
fileUpload.fileupload({
submit: function (e, data) { submit: function (e, data) {
var $this = $(this); var $this = $(this);
$this.fileupload('send', data); $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 pomFile = data.context.find('#pomFile' ).attr("checked");
var classifier = data.context.find('#classifier' ).val(); var classifier = data.context.find('#classifier' ).val();
if (!data.formData){ if (!data.formData){