mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-12 02:01:31 -04:00
chat: Move chat-specific option processing to chat.js
This commit is contained in:
parent
1cbba4ea3a
commit
a1388b7876
2 changed files with 12 additions and 24 deletions
|
@ -292,6 +292,18 @@ exports.chat = (() => {
|
|||
pad.collabClient.sendMessage({type: 'GET_CHAT_MESSAGES', start, end});
|
||||
this.historyPointer = start;
|
||||
});
|
||||
|
||||
const {searchParams} = new URL(window.location.href);
|
||||
const {showChat = true, alwaysShowChat = false, chatAndUsers = false} = clientVars.padOptions;
|
||||
const settings = this._pad.settings;
|
||||
settings.hideChat = showChat.toString() === 'false';
|
||||
if (settings.hideChat) this.hide();
|
||||
if (alwaysShowChat.toString() === 'true' && !settings.hideChat) this.stickToScreen();
|
||||
if (chatAndUsers.toString() === 'true') this.chatAndUsers();
|
||||
settings.hideChat = searchParams.get('showChat') === 'false';
|
||||
if (settings.hideChat) this.hide();
|
||||
if (searchParams.get('alwaysShowChat') === 'true' && !settings.hideChat) this.stickToScreen();
|
||||
if (searchParams.get('chatAndUsers') === 'true') this.chatAndUsers();
|
||||
},
|
||||
};
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue