hide chat if local display name is empty
This commit is contained in:
parent
0bcbd105e3
commit
ebf57923ae
|
@ -860,7 +860,13 @@ export default {
|
||||||
APP.UI.setUserAvatar(data.attributes.id, data.value);
|
APP.UI.setUserAvatar(data.attributes.id, data.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
APP.UI.addListener(UIEvents.NICKNAME_CHANGED, (nickname) => {
|
APP.UI.addListener(UIEvents.NICKNAME_CHANGED, (nickname = '') => {
|
||||||
|
nickname = nickname.trim();
|
||||||
|
|
||||||
|
if (nickname === APP.settings.getDisplayName()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
APP.settings.setDisplayName(nickname);
|
APP.settings.setDisplayName(nickname);
|
||||||
room.setDisplayName(nickname);
|
room.setDisplayName(nickname);
|
||||||
APP.UI.changeDisplayName(APP.conference.localId, nickname);
|
APP.UI.changeDisplayName(APP.conference.localId, nickname);
|
||||||
|
|
15
css/chat.css
15
css/chat.css
|
@ -22,6 +22,9 @@
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
#chatspace.is-conversation-mode #chatconversation {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
.localuser {
|
.localuser {
|
||||||
color: #087dba;
|
color: #087dba;
|
||||||
|
@ -61,6 +64,10 @@
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#chatspace.is-conversation-mode #usermsg {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
#nickname {
|
#nickname {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
@ -72,6 +79,10 @@
|
||||||
width: 95%;
|
width: 95%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#chatspace.is-conversation-mode #nickname {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
#nickinput {
|
#nickinput {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
@ -168,6 +179,10 @@
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#chatspace.is-conversation-mode #smileysarea {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
#smileysContainer {
|
#smileysContainer {
|
||||||
display: none;
|
display: none;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
|
@ -560,7 +560,7 @@ UI.updateUserRole = function (user) {
|
||||||
messageHandler.notify(
|
messageHandler.notify(
|
||||||
displayName, 'notify.somebody',
|
displayName, 'notify.somebody',
|
||||||
'connected', 'notify.grantedTo', {
|
'connected', 'notify.grantedTo', {
|
||||||
to: displayName
|
to: UIUtil.escapeHtml(displayName)
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -292,13 +292,12 @@ var Chat = {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the chat conversation mode.
|
* Sets the chat conversation mode.
|
||||||
|
* @param {boolean} isConversationMode if chat should be in
|
||||||
|
* conversation mode or not.
|
||||||
*/
|
*/
|
||||||
setChatConversationMode (isConversationMode) {
|
setChatConversationMode (isConversationMode) {
|
||||||
|
$('#chatspace').toggleClass('is-conversation-mode', isConversationMode);
|
||||||
if (isConversationMode) {
|
if (isConversationMode) {
|
||||||
$('#nickname').css({visibility: 'hidden'});
|
|
||||||
$('#chatconversation').css({visibility: 'visible'});
|
|
||||||
$('#usermsg').css({visibility: 'visible'});
|
|
||||||
$('#smileysarea').css({visibility: 'visible'});
|
|
||||||
$('#usermsg').focus();
|
$('#usermsg').focus();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -42,9 +42,7 @@ export default {
|
||||||
function update() {
|
function update() {
|
||||||
let displayName = $('#setDisplayName').val();
|
let displayName = $('#setDisplayName').val();
|
||||||
|
|
||||||
if (displayName && Settings.getDisplayName() !== displayName) {
|
emitter.emit(UIEvents.NICKNAME_CHANGED, displayName);
|
||||||
emitter.emit(UIEvents.NICKNAME_CHANGED, displayName);
|
|
||||||
}
|
|
||||||
|
|
||||||
let language = $("#languages_selectbox").val();
|
let language = $("#languages_selectbox").val();
|
||||||
if (language !== Settings.getLanguage()) {
|
if (language !== Settings.getLanguage()) {
|
||||||
|
|
Loading…
Reference in New Issue