Commit d709fdbb authored by Łukasz Nowak's avatar Łukasz Nowak

Invert logic.

Just fill until box get overflown.
parent 208fc01f
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_EtagSupport__etag</string> </key> <key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts22064959.09</string> </value> <value> <string>ts22065644.78</string> </value>
</item> </item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
...@@ -76,19 +76,17 @@ function setSoftwareReleaseEntry(item, append_to, insert_before) {\n ...@@ -76,19 +76,17 @@ function setSoftwareReleaseEntry(item, append_to, insert_before) {\n
description_div.addClass(\'software_release_description\');\n description_div.addClass(\'software_release_description\');\n
description.addClass(\'software_release_description\');\n description.addClass(\'software_release_description\');\n
maxh = description_div.height();\n maxh = description_div.height();\n
description.text(item.description);\n
var truncated = false;\n var truncated = false;\n
var original_text = description.text()\n var length = item.description.length;\n
var length = original_text.length;\n var previous = \'\';\n
while(description.height() > maxh) {\n for(i=0; i<length; i++) {\n
length-=5;\n added = item.description.slice(0, i);\n
truncated = true;\n description.text(added);\n
description.text(original_text.slice(0, length));\n if (description.height() > maxh) {\n
}\n description.text(previous+\'...\');\n
if (truncated) {\n break;\n
t = description.text().slice(0, description.text().length-3);\n }\n
t += \'...\';\n previous = added;\n
description.text(t);\n
}\n }\n
entry_div.addClass(\'software_release_entry\');\n entry_div.addClass(\'software_release_entry\');\n
}\n }\n
...@@ -259,7 +257,7 @@ function hashController ()\n ...@@ -259,7 +257,7 @@ function hashController ()\n
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>7419</int> </value> <value> <int>7323</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment