Tests: ShowChat fix (#4049)

Resolves https://github.com/ether/etherpad-lite/issues/3541
This commit is contained in:
John McLear 2020-05-28 15:18:13 +01:00 committed by GitHub
parent febd48954c
commit 40f36d7eb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 4 deletions

View file

@ -47,6 +47,9 @@ var chat = (function()
},
stickToScreen: function(fromInitialCall) // Make chat stick to right hand side of screen
{
if(pad.settings.hideChat){
return;
}
chat.show();
isStuck = (!isStuck || fromInitialCall);
$('#chatbox').hide();

View file

@ -74,7 +74,7 @@ function randomString()
var getParameters = [
{ name: "noColors", checkVal: "true", callback: function(val) { settings.noColors = true; $('#clearAuthorship').hide(); } },
{ name: "showControls", checkVal: "true", callback: function(val) { $('#editbar').css('display', 'flex') } },
{ name: "showChat", checkVal: "true", callback: function(val) { $('#chaticon').show(); } },
{ name: "showChat", checkVal: null, callback: function(val) { if(val==="false"){settings.hideChat = true;chat.hide();$('#chaticon').hide();} } },
{ name: "showLineNumbers", checkVal: "false", callback: function(val) { settings.LineNumbersDisabled = true; } },
{ name: "useMonospaceFont", checkVal: "true", callback: function(val) { settings.useMonospaceFontGlobal = true; } },
// If the username is set as a parameter we should set a global value that we can call once we have initiated the pad.
@ -82,7 +82,7 @@ var getParameters = [
// If the userColor is set as a parameter, set a global value to use once we have initiated the pad.
{ name: "userColor", checkVal: null, callback: function(val) { settings.globalUserColor = decodeURIComponent(val); clientVars.userColor = decodeURIComponent(val); } },
{ name: "rtl", checkVal: "true", callback: function(val) { settings.rtlIsTrue = true } },
{ name: "alwaysShowChat", checkVal: "true", callback: function(val) { chat.stickToScreen(); } },
{ name: "alwaysShowChat", checkVal: "true", callback: function(val) { if(!settings.hideChat) chat.stickToScreen(); } },
{ name: "chatAndUsers", checkVal: "true", callback: function(val) { chat.chatAndUsers(); } },
{ name: "lang", checkVal: null, callback: function(val) { window.html10n.localize([val, 'en']); createCookie('language', val); } }
];
@ -92,7 +92,7 @@ function getParams()
// Tries server enforced options first..
for(var i = 0; i < getParameters.length; i++)
{
var setting = getParameters[i];
var setting = getParameters[i];
var value = clientVars.padOptions[setting.name];
if(value.toString() === setting.checkVal)
{
@ -286,6 +286,8 @@ function handshake()
$('#chaticon').hide();
$('#options-chatandusers').parent().hide();
$('#options-stickychat').parent().hide();
}else{
if(!settings.hideChat) $('#chaticon').show();
}
$("body").addClass(clientVars.readonly ? "readonly" : "readwrite")