Skip to content
Snippets Groups Projects
Commit 4dba9183 authored by Björn Schießle's avatar Björn Schießle
Browse files

add ID to upload form and check if ID exist to avoid loading invalid...

add ID to upload form and check if ID exist to avoid loading invalid javascript code for read-only views.
parent b934668b
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -12,7 +12,7 @@
</ul>
</div>
<div class="file_upload_wrapper svg">
<form data-upload-id='1' class="file_upload_form" action="<?php echo OCP\Util::linkTo('files', 'ajax/upload.php'); ?>" method="post" enctype="multipart/form-data" target="file_upload_target_1">
<form data-upload-id='1' id="data-upload-form" class="file_upload_form" action="<?php echo OCP\Util::linkTo('files', 'ajax/upload.php'); ?>" method="post" enctype="multipart/form-data" target="file_upload_target_1">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload">
<input type="hidden" class="max_human_file_size" value="(max <?php echo $_['uploadMaxHumanFilesize']; ?>)">
<input type="hidden" name="dir" value="<?php echo $_['dir'] ?>" id="dir">
......
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