CSS: chat buttons smaller when chat is open.

This commit is contained in:
John Livingston
2021-11-18 15:35:13 +01:00
parent 9b20042aad
commit 6c19f0a609
2 changed files with 20 additions and 2 deletions

View File

@ -232,6 +232,13 @@ function register ({ registerHook, peertubeHelpers }: RegisterOptions): void {
let savedMyPluginFlexGrow: string | undefined
function hackStyles (on: boolean): void {
try {
document.querySelectorAll('.peertube-plugin-livechat-buttons').forEach(buttons => {
if (on) {
buttons.classList.add('peertube-plugin-livechat-buttons-open')
} else {
buttons.classList.remove('peertube-plugin-livechat-buttons-open')
}
})
const myPluginPlaceholder: HTMLElement | null = document.querySelector('my-plugin-placeholder')
if (on) {
// Saving current style attributes and maximazing space for the chat