Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ class BootstrapFileUploadTagLib {
String id = attrs.id ?: 'fileupload'
String url = createLink(controller: attrs.controller, action: attrs.action)

String autoBind = attrs.autoBind ?: "y"

HttpMethod type = attrs.type ? HttpMethod.valueOf(attrs.type) : HttpMethod.POST
String dataType = attrs.dataType ?: 'json'
String namespace = attrs.namespace ?: id
Expand Down Expand Up @@ -166,7 +168,7 @@ class BootstrapFileUploadTagLib {

out << r.script(null) {
out << """
\$(function(){
function bindFileUpload() {
\$('#${id}').fileupload({
url: '${url}',
${type ? "type: '${type}'," : ""}
Expand Down Expand Up @@ -219,10 +221,14 @@ class BootstrapFileUploadTagLib {
});"""
}
out << """
});
};
"""
}

if(autoBind=='y') {
out << "\nbindFileUpload();\n"
}

out << """
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">"""
Expand Down