mirror of
https://github.com/zotero/zotero.git
synced 2026-10-08 03:08:19 +00:00
Display "(...) " before "Abstract:" when abstract field is cropped
I can't find any way to detect if the value is actually cropped with an ellipsis, so the best we can do is not display the ellipsis if the value is blank--if the value is shorter than the crop width but not empty, the ellipsis will still display.
This commit is contained in:
parent
3e7ddd04d8
commit
58235c6bf6
1 changed files with 17 additions and 1 deletions
|
|
@ -303,7 +303,16 @@ var ZoteroItemPane = new function()
|
|||
|
||||
var label = document.createElement("label");
|
||||
label.setAttribute('fieldname', fieldNames[i]);
|
||||
label.setAttribute("value", Zotero.ItemFields.getLocalizedString(_itemBeingEdited.getType(), fieldNames[i]) + ":");
|
||||
|
||||
var prefix = '';
|
||||
// Add '(...)' before 'Abstract:' for collapsed abstracts
|
||||
if (fieldNames[i] == 'abstract') {
|
||||
if (val && !Zotero.Prefs.get('lastAbstractExpand')) {
|
||||
prefix = '(...) ';
|
||||
}
|
||||
}
|
||||
label.setAttribute("value", prefix +
|
||||
Zotero.ItemFields.getLocalizedString(_itemBeingEdited.getType(), fieldNames[i]) + ":");
|
||||
|
||||
if (fieldNames[i] == 'url' && val) {
|
||||
label.setAttribute("isButton", true);
|
||||
|
|
@ -835,6 +844,13 @@ var ZoteroItemPane = new function()
|
|||
var tabindex = ab.getAttribute('ztabindex');
|
||||
var elem = createValueElement(valueText, 'abstract', tabindex);
|
||||
ab.parentNode.replaceChild(elem, ab);
|
||||
|
||||
var text = Zotero.ItemFields.getLocalizedString(_itemBeingEdited.getType(), 'abstract') + ':';
|
||||
// Add '(...)' before "Abstract:" for collapsed abstracts
|
||||
if (valueText && cur) {
|
||||
text = '(...) ' + text;
|
||||
}
|
||||
label.setAttribute('value', text);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue