Skip to content

Commit

Permalink
Accept a selector string or DOM element as filesContainer option.
Browse files Browse the repository at this point in the history
  • Loading branch information
blueimp committed Mar 6, 2012
1 parent 276de2e commit 9737048
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions js/jquery.fileupload-ui.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* jQuery File Upload User Interface Plugin 6.6
* jQuery File Upload User Interface Plugin 6.6.1
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
Expand Down Expand Up @@ -573,24 +573,31 @@
options.filesContainer.prop('nodeName')
);
if (tmpl) {
options.uploadTemplate = tmpl(options.uploadTemplateId);
options.downloadTemplate = tmpl(options.downloadTemplateId);
if (options.uploadTemplateId) {
options.uploadTemplate = tmpl(options.uploadTemplateId);
}
if (options.downloadTemplateId) {
options.downloadTemplate = tmpl(options.downloadTemplateId);
}
}
},

_initFilesContainer: function () {
if (!this.options.filesContainer) {
this.options.filesContainer = this.element.find('.files');
var options = this.options;
if (options.filesContainer === undefined) {
options.filesContainer = this.element.find('.files');
} else if (!(options.filesContainer instanceof $)) {
options.filesContainer = $(options.filesContainer);
}
},

_initSpecialOptions: function () {
parentWidget.prototype._initSpecialOptions.call(this);
this._initFilesContainer();
this._initTemplates();
},

_create: function () {
this._initFilesContainer();
parentWidget.prototype._create.call(this);
this._refreshOptionsList.push(
'filesContainer',
Expand Down

0 comments on commit 9737048

Please sign in to comment.