Made editions in PR

This commit is contained in:
Ilya Daynatovich 2016-12-05 13:02:31 +02:00 committed by Lyubomir Marinov
parent 83dd56d34c
commit 986f13ef1a
1 changed files with 7 additions and 5 deletions

View File

@ -7,10 +7,12 @@ import UIUtil from '../util/UIUtil';
var animateTimeout, updateTimeout;
function enter_room() {
var val = $("#enter_room_field").val();
function enterRoom() {
const $enterRoomField = $("#enter_room_field");
var val = $enterRoomField.val();
if(!val) {
val = $("#enter_room_field").attr("room_name");
val = $enterRoomField.attr("room_name");
}
if (val) {
window.location.pathname = "/" + val;
@ -68,12 +70,12 @@ function setupWelcomePage() {
}
$("#enter_room_button").click(function() {
enter_room();
enterRoom();
});
$("#enter_room_field").keydown(function (event) {
if (event.keyCode === 13 /* enter */) {
enter_room();
enterRoom();
}
});