use form for editing room name

This commit is contained in:
deardrops 2017-05-03 20:24:01 +08:00 committed by WEBXOSS
parent 7c389507a9
commit 7a0a1e73e5
2 changed files with 8 additions and 4 deletions

View file

@ -856,14 +856,16 @@ $('link-edit-deck').onclick = function (event) {
return false;
};
$('room-name').onblur = function (event) {
var roomName = event.target.value;
$('room-name-form').onsubmit = function (event) {
var roomName = $('room-name').value;
if (roomName) {
socket.emit('renameRoom', {
'roomName': roomName
});
}
};
event.preventDefault();
return false;
}
/* 直播 */
var stopFetchingLive = 0;

View file

@ -87,7 +87,9 @@
<tbody>
<tr>
<td colspan="100">
<input id="room-name" type="text"></input>
<form id="room-name-form">
<input id="room-name" type="text"></input>
</form>
</td>
</tr>
<tr>