Skip to content
Snippets Groups Projects
Commit e31d7403 authored by Jörn Friedrich Dreyer's avatar Jörn Friedrich Dreyer
Browse files

use local variable to walk DOM only once

parent 868d7b95
No related branches found
No related tags found
No related merge requests found
......@@ -354,7 +354,8 @@ var FileList={
$(document).ready(function(){
// handle upload events
$('#file_upload_start').on('fileuploaddrop', function(e, data) {
var file_upload_start = $('#file_upload_start');
file_upload_start.on('fileuploaddrop', function(e, data) {
// only handle drop to dir if fileList exists
if ($('#fileList').length > 0) {
var dropTarget = $(e.originalEvent.target).closest('tr');
......@@ -377,7 +378,7 @@ $(document).ready(function(){
}
}
});
$('#file_upload_start').on('fileuploadadd', function(e, data) {
file_upload_start.on('fileuploadadd', function(e, data) {
// only add to fileList if it exists
if ($('#fileList').length > 0) {
......@@ -421,7 +422,7 @@ $(document).ready(function(){
}
}
});
$('#file_upload_start').on('fileuploaddone', function(e, data) {
file_upload_start.on('fileuploaddone', function(e, data) {
// only update the fileList if it exists
if ($('#fileList').length > 0) {
var response;
......@@ -472,7 +473,7 @@ $(document).ready(function(){
}
}
});
$('#file_upload_start').on('fileuploadfail', function(e, data) {
file_upload_start.on('fileuploadfail', function(e, data) {
// only update the fileList if it exists
// cleanup files, error notification has been shown by fileupload code
var tr = data.context;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment