Fixes #263, view page button overflows window

This commit is contained in:
Dan Stillman 2006-09-27 17:35:27 +00:00
parent 610f5b2c3a
commit 20c46cf1e1

View File

@ -247,7 +247,26 @@ var ScholarPane = new function()
} }
else if(item.isAttachment()) 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 if (item.ref.getAttachmentLinkMode() == Scholar.Attachments.LINK_MODE_LINKED_URL
|| item.ref.getAttachmentLinkMode() == Scholar.Attachments.LINK_MODE_IMPORTED_URL) || item.ref.getAttachmentLinkMode() == Scholar.Attachments.LINK_MODE_IMPORTED_URL)
{ {