diff --git a/public/src/installer/install.js b/public/src/installer/install.js index 876d6bb4d3..4fc8677266 100644 --- a/public/src/installer/install.js +++ b/public/src/installer/install.js @@ -5,6 +5,17 @@ $('document').ready(function() { setupInputs(); $('[name="username"]').focus(); + activate('database', $('[name="database"]')); + + if ($('#database-error').length) { + $('[name="database"]').parents('.input-row').addClass('error'); + $('html, body').animate({ + scrollTop: ($('#database-error').offset().top + 100) + 'px' + }, 400); + } + + $('#launch').on('click', launchForum); + function setupInputs() { @@ -23,15 +34,6 @@ $('document').ready(function() { }); $('form').submit(validateAll); - - activate('database', $('[name="database"]')); - - if ($('#database-error').length) { - $('[name="database"]').parents('.input-row').addClass('error'); - $('html, body').animate({ - scrollTop: ($('#database-error').offset().top + 100) + 'px' - }, 400); - } } function validateAll(ev) { @@ -39,7 +41,7 @@ $('document').ready(function() { activate($(this).attr('name'), $(this)); }); - if ($('.error').length) { + if ($('form .admin .error').length) { ev.preventDefault(); $('html, body').animate({'scrollTop': '0px'}, 400); @@ -107,4 +109,8 @@ $('document').ready(function() { return switchDatabase(field); } } + + function launchForum() { + $('#launch .fa-spin').removeClass('hide'); + } }); \ No newline at end of file diff --git a/src/views/install/index.tpl b/src/views/install/index.tpl index beb32f9419..98781e3821 100644 --- a/src/views/install/index.tpl +++ b/src/views/install/index.tpl @@ -8,6 +8,7 @@ + @@ -57,28 +58,28 @@