Changed file dropper to autodetect "allowmultiple"
This commit is contained in:
parent
12b43b1bb8
commit
23f5100cf8
2 changed files with 2 additions and 2 deletions
|
@ -3,11 +3,11 @@ App.Controls = App.Controls || {};
|
||||||
|
|
||||||
App.Controls.FileDropper = function(
|
App.Controls.FileDropper = function(
|
||||||
$fileInput,
|
$fileInput,
|
||||||
allowMultiple,
|
|
||||||
onChange,
|
onChange,
|
||||||
jQuery) {
|
jQuery) {
|
||||||
|
|
||||||
var $dropDiv = jQuery('<div class="file-handler"></div>');
|
var $dropDiv = jQuery('<div class="file-handler"></div>');
|
||||||
|
var allowMultiple = $fileInput.attr('multiple');
|
||||||
$dropDiv.html((allowMultiple ? 'Drop files here!' : 'Drop file here!') + '<br/>Or just click on this box.');
|
$dropDiv.html((allowMultiple ? 'Drop files here!' : 'Drop file here!') + '<br/>Or just click on this box.');
|
||||||
$dropDiv.insertBefore($fileInput);
|
$dropDiv.insertBefore($fileInput);
|
||||||
$fileInput.attr('multiple', allowMultiple);
|
$fileInput.attr('multiple', allowMultiple);
|
||||||
|
|
|
@ -52,7 +52,7 @@ App.Presenters.UserAccountSettingsPresenter = function(
|
||||||
$el.find('form').submit(accountSettingsFormSubmitted);
|
$el.find('form').submit(accountSettingsFormSubmitted);
|
||||||
$el.find('form [name=avatar-style]').change(avatarStyleChanged);
|
$el.find('form [name=avatar-style]').change(avatarStyleChanged);
|
||||||
avatarStyleChanged();
|
avatarStyleChanged();
|
||||||
new App.Controls.FileDropper($el.find('[name=avatar-content]'), false, avatarContentChanged, jQuery);
|
new App.Controls.FileDropper($el.find('[name=avatar-content]'), avatarContentChanged, jQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPrivileges() {
|
function getPrivileges() {
|
||||||
|
|
Loading…
Reference in a new issue