From 23f5100cf899a08097eb3d3f65d4f2e3e094136f Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sat, 13 Sep 2014 16:09:23 +0200 Subject: [PATCH] Changed file dropper to autodetect "allowmultiple" --- public_html/js/Controls/FileDropper.js | 2 +- public_html/js/Presenters/UserAccountSettingsPresenter.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public_html/js/Controls/FileDropper.js b/public_html/js/Controls/FileDropper.js index cf21d417..8e2b6cf6 100644 --- a/public_html/js/Controls/FileDropper.js +++ b/public_html/js/Controls/FileDropper.js @@ -3,11 +3,11 @@ App.Controls = App.Controls || {}; App.Controls.FileDropper = function( $fileInput, - allowMultiple, onChange, jQuery) { var $dropDiv = jQuery('
'); + var allowMultiple = $fileInput.attr('multiple'); $dropDiv.html((allowMultiple ? 'Drop files here!' : 'Drop file here!') + '
Or just click on this box.'); $dropDiv.insertBefore($fileInput); $fileInput.attr('multiple', allowMultiple); diff --git a/public_html/js/Presenters/UserAccountSettingsPresenter.js b/public_html/js/Presenters/UserAccountSettingsPresenter.js index 32fd2da0..febc9b24 100644 --- a/public_html/js/Presenters/UserAccountSettingsPresenter.js +++ b/public_html/js/Presenters/UserAccountSettingsPresenter.js @@ -52,7 +52,7 @@ App.Presenters.UserAccountSettingsPresenter = function( $el.find('form').submit(accountSettingsFormSubmitted); $el.find('form [name=avatar-style]').change(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() {