X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/eba408949fa0e51251ed4d82285c2caf9fd4b5f0..5d78f2b7af4ee0f1aa48f1e2538ef40ea6b19b00:/stage2/static/js/checkfile.js diff --git a/stage2/static/js/checkfile.js b/stage2/static/js/checkfile.js index 9d1ae97..19db762 100644 --- a/stage2/static/js/checkfile.js +++ b/stage2/static/js/checkfile.js @@ -19,9 +19,10 @@ $(function() { ok = false; } } + var max_size = this.getAttribute('data-max') || 20; var size = this.files[0].size; - if (size > 20 * 1024 * 1024) { - alert('Rozmiar pliku nie może przekraczać 20 MB!'); + if (size > max_size * 1024 * 1024) { + alert('Rozmiar pliku nie może przekraczać ' + max_size + ' MB!'); ok = false; } if (!ok) {