]> source.dussan.org Git - nextcloud-server.git/commitdiff
use local variable to walk DOM only once
authorJörn Friedrich Dreyer <jfd@butonic.de>
Wed, 27 Mar 2013 14:55:44 +0000 (15:55 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Mon, 1 Jul 2013 17:35:22 +0000 (19:35 +0200)
apps/files/js/filelist.js

index 4fdb76b1026899134bb46ba5a08cf36378616fc4..70c3332ccaf885c251a5ab0e4f5ab5fd57bbed7d 100644 (file)
@@ -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;