diff --git a/web/skins/classic/js/skin.js b/web/skins/classic/js/skin.js index 43deab3d4..99c2d2016 100644 --- a/web/skins/classic/js/skin.js +++ b/web/skins/classic/js/skin.js @@ -1863,18 +1863,22 @@ function calcTextSizeOnInfoBlock(el) { return parseInt((w/textLength) * 0.6 / d); // ~40% of the block width } -function setTextSizeOnInfoBlock() { +function setTextSizeOnInfoBlocks() { const block = document.querySelectorAll('[id ^= "stream-info-block"]'); Array.prototype.forEach.call(block, (el) => { - if (el.innerText.length == 0) return; - const fontSize = calcTextSizeOnInfoBlock(el); - el.style.fontSize = fontSize + "px"; - el.classList.remove("text-3d-mini", "text-3d"); - const blockClass = (fontSize !== fontSize || fontSize < 50) ? 'text-3d-mini' : 'text-3d'; - el.classList.add(blockClass); + setTextSizeOnInfoBlock(el); }); } +function setTextSizeOnInfoBlock(el) { + if (el.innerText.length == 0) return; + const fontSize = calcTextSizeOnInfoBlock(el); + el.style.fontSize = fontSize + "px"; + el.classList.remove("text-3d-mini", "text-3d"); + const blockClass = (fontSize !== fontSize || fontSize < 50) ? 'text-3d-mini' : 'text-3d'; + el.classList.add(blockClass); +} + /* * date - object type Date() * shift.offset - number (can be negative) @@ -2789,7 +2793,7 @@ function monitorsSetScale(id=null) { } } // End function _setScale setButtonSizeOnStream(); - setTextSizeOnInfoBlock(); + setTextSizeOnInfoBlocks(); } // End function monitorsSetScale /*IMPORTANT DO NOT CALL WITHOUT CONSCIOUS NEED!!!*/