mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
working logic
This commit is contained in:
parent
17fa87552d
commit
753e8fdf0b
2 changed files with 6 additions and 4 deletions
|
@ -54,16 +54,17 @@ var chat = (function()
|
||||||
isStuck = false;
|
isStuck = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
chatAndUsers: function(status){
|
chatAndUsers: function(fromInitialCall)
|
||||||
if(status || $('#options-chatandusers').prop('checked')){
|
{
|
||||||
|
if(fromInitialCall || $('#options-chatandusers').prop('checked')){
|
||||||
padcookie.setPref("chatAndUsers", true);
|
padcookie.setPref("chatAndUsers", true);
|
||||||
chat.stickToScreen(true);
|
chat.stickToScreen(true);
|
||||||
|
$('#options-stickychat').prop('checked', true)
|
||||||
$('#options-stickychat').prop("disabled", "disabled");
|
$('#options-stickychat').prop("disabled", "disabled");
|
||||||
$('#users').addClass("chatAndUsers");
|
$('#users').addClass("chatAndUsers");
|
||||||
$("#chatbox").addClass("chatAndUsersChat");
|
$("#chatbox").addClass("chatAndUsersChat");
|
||||||
}else{
|
}else{
|
||||||
padcookie.setPref("chatAndUsers", false);
|
padcookie.setPref("chatAndUsers", false);
|
||||||
chat.stickToScreen(false);
|
|
||||||
$('#options-stickychat').prop("disabled", false);
|
$('#options-stickychat').prop("disabled", false);
|
||||||
$('#users').removeClass("chatAndUsers");
|
$('#users').removeClass("chatAndUsers");
|
||||||
$("#chatbox").removeClass("chatAndUsersChat");
|
$("#chatbox").removeClass("chatAndUsersChat");
|
||||||
|
|
|
@ -784,6 +784,7 @@ var pad = {
|
||||||
handleIsFullyConnected: function(isConnected, isInitialConnect)
|
handleIsFullyConnected: function(isConnected, isInitialConnect)
|
||||||
{
|
{
|
||||||
pad.determineChatVisibility(isConnected && !isInitialConnect);
|
pad.determineChatVisibility(isConnected && !isInitialConnect);
|
||||||
|
pad.determineChatAndUsersVisibility(isConnected && !isInitialConnect);
|
||||||
pad.determineAuthorshipColorsVisibility();
|
pad.determineAuthorshipColorsVisibility();
|
||||||
},
|
},
|
||||||
determineChatVisibility: function(asNowConnectedFeedback){
|
determineChatVisibility: function(asNowConnectedFeedback){
|
||||||
|
@ -796,7 +797,7 @@ var pad = {
|
||||||
$('#options-stickychat').prop("checked", false); // set the checkbox for off
|
$('#options-stickychat').prop("checked", false); // set the checkbox for off
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
determineChatAndUsersVisibility: function(){
|
determineChatAndUsersVisibility: function(asNowConnectedFeedback){
|
||||||
var chatAUVisCookie = padcookie.getPref('chatAndUsersVisible');
|
var chatAUVisCookie = padcookie.getPref('chatAndUsersVisible');
|
||||||
if(chatAUVisCookie){ // if the cookie is set for chat always visible
|
if(chatAUVisCookie){ // if the cookie is set for chat always visible
|
||||||
chat.chatAndUsers(true); // stick it to the screen
|
chat.chatAndUsers(true); // stick it to the screen
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue