Correction proportions annotations
authorveltr
Fri, 27 Jan 2012 15:40:10 +0100
changeset 475 fb7d796d52a7
parent 474 5e7942f049a6
child 476 c8338a96f94c
Correction proportions annotations
src/ldt/ldt/static/ldt/js/Ldt_front_sparkline.js
--- a/src/ldt/ldt/static/ldt/js/Ldt_front_sparkline.js	Fri Jan 27 15:26:57 2012 +0100
+++ b/src/ldt/ldt/static/ldt/js/Ldt_front_sparkline.js	Fri Jan 27 15:40:10 2012 +0100
@@ -37,7 +37,12 @@
     $(".polemics li").each(function(_i,_e) {
         var _sp = $(_e).find("span");
         if (parseInt(_sp.text())) {
-            $(_e).css("width",(2 + _sp.width())+"px");
+            var _newWidth = (2 + _sp.width());
+            if ($(_e).width() < _newWidth) {
+                $(_e).css("width",_newWidth+"px");
+            }
+        } else {
+            $(_e).detach();
         }
     });
 });
\ No newline at end of file