From 7c389507a9514eb8b5654412aad257f11c3db984 Mon Sep 17 00:00:00 2001 From: deardrops Date: Wed, 3 May 2017 19:44:53 +0800 Subject: [PATCH] rename room --- RoomManager.js | 11 ++++++++++- css.css | 3 +++ index.html | 4 +++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/RoomManager.js b/RoomManager.js index 1a162a6..ea6de3c 100644 --- a/RoomManager.js +++ b/RoomManager.js @@ -608,7 +608,7 @@ function updateRoom (msgObj) { audio.playSoundEffect('JoinRoom'); } - $('room-name').textContent = msgObj.roomName; + $('room-name').value = msgObj.roomName; $('room-host-nickname').textContent = msgObj.host; $('room-guest-nickname').textContent = msgObj.guest; setClass($('room-guest-nickname'),'ready',msgObj.guestReady); @@ -856,6 +856,15 @@ $('link-edit-deck').onclick = function (event) { return false; }; +$('room-name').onblur = function (event) { + var roomName = event.target.value; + if (roomName) { + socket.emit('renameRoom', { + 'roomName': roomName + }); + } +}; + /* 直播 */ var stopFetchingLive = 0; var watchingLive = false; diff --git a/css.css b/css.css index 25f59fb..a85ae4c 100644 --- a/css.css +++ b/css.css @@ -415,6 +415,9 @@ ol,ul,li { color: #f2442b; font-size: 150%; font-weight: bold; + text-align: center; + background: transparent; + border: none; } #room-host-nickname { color: #77d25b; diff --git a/index.html b/index.html index 4fb0205..258cd42 100644 --- a/index.html +++ b/index.html @@ -86,7 +86,9 @@ - +
+ +