summaryrefslogtreecommitdiff
path: root/js/functions.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-08-09 13:08:07 +0400
committerAndrew Dolgov <[email protected]>2012-08-09 13:08:07 +0400
commit26e4b12466208b433fef35946cb61ef9b3e52e45 (patch)
treeecea436be258b93abe7c1a1ee219f17f18c4cb47 /js/functions.js
parent18e8dc12d9ad11093013fec590c2c29630b8ac95 (diff)
add experimental clientside headline clamping (refs #479)
Diffstat (limited to 'js/functions.js')
-rw-r--r--js/functions.js9
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 += "&hellip;";
+ }
+}