From: Maciej Tronowski Date: Tue, 21 Apr 2015 11:57:49 +0000 (+0200) Subject: set focus on modal form X-Git-Tag: v1.0~55 X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=commitdiff_plain;h=5456abffdf1fee64a216e7a8a6d09ba3fd01b3bd;p=qcg-portal.git set focus on modal form --- diff --git a/qcg/templates/qcg/gridftp.html b/qcg/templates/qcg/gridftp.html index 9eb5cee..12fe644 100644 --- a/qcg/templates/qcg/gridftp.html +++ b/qcg/templates/qcg/gridftp.html @@ -54,8 +54,6 @@ function conflictingName(name, modal) { if (filex.files.some(function(item) { return item.get('name') == name })) { - modal.find('.alert').remove(); - $('
', { 'class': 'alert alert-danger', html: ' Plik o podanej już nazwie istnieje!' @@ -88,8 +86,10 @@ }); $('form').on('show.bs.modal', function() { - console.log('reset'); + $(this).find('.alert').remove(); this.reset(); + }).on('shown.bs.modal', function() { + $(this).find('input[type="text"]')[0].focus(); }); $('#btn-upload').on('click', function() {