From 4fb717b6be45cdd76a7a7de5e6947ac62d13b5a7 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 13 May 2014 21:04:45 +0200 Subject: [PATCH] Use form instead of simple divs for paswords So hitting enter also submit it --- public/js/vroom.js | 10 +++++----- templates/default/join.html.ep | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/public/js/vroom.js b/public/js/vroom.js index c87c5b0..3cd469b 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -681,7 +681,8 @@ function initVroom(room) { }); // Join password protection - $('#setJoinPassButton').click(function(event) { + $('#joinPassForm').submit(function(event) { + event.preventDefault(); var pass = $('#joinPass').val(); $('#joinPass').val(''); $('#setJoinPassButton').addClass('disabled'); @@ -734,7 +735,7 @@ function initVroom(room) { }); }); - + // Set owner password $('#ownerPass').on('input', function() { if ($('#ownerPass').val() == ''){ $('#setOwnerPassButton').addClass('disabled'); @@ -743,9 +744,8 @@ function initVroom(room) { $('#setOwnerPassButton').removeClass('disabled'); } }); - - // Set owner password - $('#setOwnerPassButton').click(function(event) { + $('#ownerPassForm').submit(function(event) { + event.preventDefault(); var pass = $('#ownerPass').val(); $('#ownerPass').val(''); $('#setOwnerPassButton').addClass('disabled'); diff --git a/templates/default/join.html.ep b/templates/default/join.html.ep index ac1b66e..553f4c2 100644 --- a/templates/default/join.html.ep +++ b/templates/default/join.html.ep @@ -87,14 +87,14 @@