tors / jquery-fileupload-rails

jQuery File Upload integrated for Rails
669 stars 254 forks source link

A couple of the asset files seem to be mutually exclusive #85

Open JFimex opened 8 years ago

JFimex commented 8 years ago

I am not 100% sure if this is a bug or a misuse on my part When I include both jquery-fileupload/vendor/tmpl and jquery-fileupload/jquery.fileupload-ui (which is done when you include just jquery-fileupload) I get "TypeError: document.getElementById(...) is null" In the console and the fileuploader fails to load.

Recreate:

<!DOCTYPE html>
<html>
    <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<!--//= require jquery2 -->
<script src="./recreate/jquery2.self.js" ></script>

<!--//= require jquery-fileupload/vendor/jquery.ui.widget -->
<script src="./recreate/jquery.ui.widget.self.js" ></script>

<!--//= require jquery-fileupload/vendor/tmpl
<script src="./recreate/tmpl.self.js" ></script>
-->

<!--//= require jquery-fileupload/jquery.fileupload-->
<script src="./recreate/jquery.fileupload.self.js" ></script>

<!--//= require jquery-fileupload/jquery.fileupload-ui
<script src="./recreate/jquery.fileupload-ui.self.js" ></script>
-->

    <body>

    <form class="new_file_container" id="new_file_container" enctype="multipart/form-data"
        action="http://localhost:3000/file_containers" accept-charset="UTF-8" method="post">
        <input multiple="multiple" type="file" name="file_container[uploaded_file][]"
            id="file_container_uploaded_file">
    </form>
    <script>
    $(function() {
        $('#file_container_uploaded_file').fileupload({
            add: function(a,b) {
                console.log("testing");
                console.log(a);
                console.log(b);
            }
        });
    });
    </script>

</body></html>