diff options
| author | sD <stoned@derpymail.org> | 2020-04-18 15:32:07 +0200 |
|---|---|---|
| committer | sD <stoned@derpymail.org> | 2020-04-18 15:32:07 +0200 |
| commit | cc95e7d8393e6862b571e6c83c713a3284a6f895 (patch) | |
| tree | 1b567f983ffabb51874212b24c9cbefd25a0ab3c /webAO/client.js | |
| parent | f9715cc1a7869c8ade47052659dd31b8b4d6cc27 (diff) | |
let the users pin the box to 1 style if they want
Diffstat (limited to 'webAO/client.js')
| -rw-r--r-- | webAO/client.js | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/webAO/client.js b/webAO/client.js index c44ed74..dace52b 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -1641,12 +1641,7 @@ async changeBackground(position) { this.changeBackground(chatmsg.side); - const chatbox_theme = document.getElementById("chatbox_theme"); - if (chatbox_arr.includes(chatmsg.chatbox)) { - chatbox_theme.href = "styles/chatbox/" + chatmsg.chatbox + ".css"; - } else { - chatbox_theme.href = "styles/chatbox/aa.css"; - } + setChatbox(chatmsg.chatbox); resizeChatbox(); // Flip the character @@ -2438,6 +2433,20 @@ export function getIndexFromSelect(select_box, value) { } window.getIndexFromSelect = getIndexFromSelect; +export function setChatbox(style) { + const chatbox_theme = document.getElementById("chatbox_theme"); + const selected_theme = document.getElementById("client_chatboxselect").value; + if(selected_theme === "dynamic") { + if (chatbox_arr.includes(style)) { + chatbox_theme.href = "styles/chatbox/" + style + ".css"; + } else { + chatbox_theme.href = "styles/chatbox/aa.css"; + } + } else { + chatbox_theme.href = "styles/chatbox/" + selected_theme + ".css"; + } +} + /** * Set the font size for the chatbox */ |
