From 4b446f3eddd31829b844b09b8169a85350b26d2b Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Sun, 7 Oct 2012 17:17:37 -0400 Subject: Revert part of 5beca59b, fixes file upload bug oc-1926 --- apps/files/js/files.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'apps/files/js/files.js') diff --git a/apps/files/js/files.js b/apps/files/js/files.js index e4037454520..c7f4c4ce080 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -200,8 +200,6 @@ $(document).ready(function() { e.preventDefault(); // prevent browser from doing anything, if file isn't dropped in dropZone }); - if ( document.getElementById("file_upload_start") ) { - $(function() { $('.file_upload_start').fileupload({ dropZone: $('#content'), // restrict dropZone to content div @@ -415,8 +413,7 @@ $(document).ready(function() { } }) }); - } - + $.assocArraySize = function(obj) { // http://stackoverflow.com/a/6700/11236 var size = 0, key; -- cgit v1.2.3 From 4dba91838ff24202fa7e184469074b61a4872d1e Mon Sep 17 00:00:00 2001 From: Björn Schießle Date: Mon, 8 Oct 2012 10:28:29 +0200 Subject: add ID to upload form and check if ID exist to avoid loading invalid javascript code for read-only views. --- apps/files/js/files.js | 5 +++-- apps/files/templates/index.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'apps/files/js/files.js') diff --git a/apps/files/js/files.js b/apps/files/js/files.js index c7f4c4ce080..b36e46813dc 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -199,7 +199,8 @@ $(document).ready(function() { $(document).bind('drop dragover', function (e) { e.preventDefault(); // prevent browser from doing anything, if file isn't dropped in dropZone }); - + + if ( document.getElementById("data-upload-form") ) { $(function() { $('.file_upload_start').fileupload({ dropZone: $('#content'), // restrict dropZone to content div @@ -413,7 +414,7 @@ $(document).ready(function() { } }) }); - + } $.assocArraySize = function(obj) { // http://stackoverflow.com/a/6700/11236 var size = 0, key; diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index aff484f0a7a..d49f2f4d5d3 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -12,7 +12,7 @@
-
+ -- cgit v1.2.3