commit 20c46cf1e13af3c8e989a60a9201cfc6e167333c
parent 610f5b2c3a32e9ffdedab5d8155f996804358c3b
Author: Dan Stillman <dstillman@zotero.org>
Date: Wed, 27 Sep 2006 17:35:27 +0000
Fixes #263, view page button overflows window
Diffstat:
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/chrome/chromeFiles/content/scholar/overlay.js b/chrome/chromeFiles/content/scholar/overlay.js
@@ -247,7 +247,26 @@ var ScholarPane = new function()
}
else if(item.isAttachment())
{
- document.getElementById('scholar-attachment-label').setAttribute('value',item.getField('title'));
+ // Wrap title to multiple lines if necessary
+ var label = document.getElementById('scholar-attachment-label');
+ while (label.hasChildNodes())
+ {
+ label.removeChild(label.firstChild);
+ }
+ var val = item.getField('title');
+ var firstSpace = val.indexOf(" ");
+ // Crop long uninterrupted text
+ if ((firstSpace == -1 && val.length > 29 ) || firstSpace > 29)
+ {
+ label.setAttribute('crop', 'end');
+ label.setAttribute('value', val);
+ }
+ // Create a <description> element, essentially
+ else
+ {
+ label.appendChild(document.createTextNode(val));
+ }
+
if (item.ref.getAttachmentLinkMode() == Scholar.Attachments.LINK_MODE_LINKED_URL
|| item.ref.getAttachmentLinkMode() == Scholar.Attachments.LINK_MODE_IMPORTED_URL)
{