diff options
Diffstat (limited to 'js/functions.js')
-rw-r--r-- | js/functions.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/js/functions.js b/js/functions.js index b2d79dc56..997d55a55 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1718,3 +1718,12 @@ function get_radio_checked(radioObj) { } return(""); } + +function clamp_element(elem, height) { + if (elem && elem.offsetHeight > height) { + while (elem.offsetHeight > height) + elem.innerHTML = cp.innerHTML.substring(0, elem.innerHTML.length - 50); + + elem.innerHTML += "…"; + } +} |