diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index 1e4184f068..ceee9aa887 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -396,18 +396,18 @@ } } - var valueElement = this.createValueElement( + let label = document.createElement("label"); + label.setAttribute('fieldname', fieldName); + + let valueElement = this.createValueElement( val, fieldName, tabindex ); - var label = document.createElement("label"); - label.setAttribute('fieldname', fieldName); - var prefix = ''; // Add '(...)' before 'Abstract:' for collapsed abstracts if (fieldName == 'abstractNote') { if (val && !Zotero.Prefs.get('lastAbstractExpand')) { - prefix = '(...) '; + prefix = '(\u2026) '; } } @@ -418,7 +418,7 @@ // TEMP - NSF (homepage) if ((fieldName == 'url' || fieldName == 'homepage') && val) { - label.setAttribute("isButton", true); + label.classList.add("pointer"); // TODO: make getFieldValue non-private and use below instead label.setAttribute("onclick", "ZoteroPane_Local.loadURI(this.nextSibling.firstChild ? this.nextSibling.firstChild.nodeValue : this.nextSibling.value, event)"); label.setAttribute("tooltiptext", Zotero.getString('locate.online.tooltip')); @@ -428,7 +428,7 @@ var doi = Zotero.Utilities.cleanDOI(val); if (doi) { doi = "http://dx.doi.org/" + encodeURIComponent(doi); - label.setAttribute("isButton", true); + label.classList.add("pointer"); label.setAttribute("onclick", "ZoteroPane_Local.loadURI('" + doi + "', event)"); label.setAttribute("tooltiptext", Zotero.getString('locate.online.tooltip')); valueElement.setAttribute('contextmenu', 'zotero-doi-menu'); @@ -441,9 +441,19 @@ } } else if (fieldName == 'abstractNote') { - label.setAttribute("onclick", - "if (this.nextSibling.inputField) { this.nextSibling.inputField.blur(); } " - + "else { document.getBindingParent(this).toggleAbstractExpand(this); }"); + if (val.length) { + label.classList.add("pointer"); + } + label.addEventListener('click', function () { + if (this.nextSibling.inputField) { + this.nextSibling.inputField.blur(); + } + else { + document.getBindingParent(this).toggleAbstractExpand( + this, this.nextSibling + ); + } + }); } else { label.setAttribute("onclick", @@ -1161,25 +1171,25 @@ + @@ -1357,6 +1367,14 @@ valueElement.appendChild(document.createTextNode(valueText)); } + // Allow toggling non-editable Abstract open and closed with click + if (fieldName == 'abstractNote' && !this.editable) { + valueElement.classList.add("pointer"); + valueElement.addEventListener('click', function () { + this.toggleAbstractExpand(valueElement.previousSibling, valueElement); + }.bind(this)); + } + return valueElement; ]]> diff --git a/chrome/skin/default/zotero/bindings/itembox.css b/chrome/skin/default/zotero/bindings/itembox.css index c3343b97f4..efd21c112d 100644 --- a/chrome/skin/default/zotero/bindings/itembox.css +++ b/chrome/skin/default/zotero/bindings/itembox.css @@ -40,16 +40,15 @@ row > label border: 1px solid transparent; } -row label:first-child[isButton=true]:hover -{ - cursor: pointer !important; -} - row label { -moz-user-focus: ignore; } +row .pointer:hover { + cursor: pointer !important; +} + /* creator type menu */ .creator-type-label, .creator-type-value { diff --git a/defaults/preferences/zotero.js b/defaults/preferences/zotero.js index eebd0dea89..9ef02ed09e 100644 --- a/defaults/preferences/zotero.js +++ b/defaults/preferences/zotero.js @@ -60,7 +60,7 @@ pref("extensions.zotero.backup.numBackups", 2); pref("extensions.zotero.backup.interval", 1440); pref("extensions.zotero.lastCreatorFieldMode",0); -pref("extensions.zotero.lastAbstractExpand",0); +pref("extensions.zotero.lastAbstractExpand", true); pref("extensions.zotero.lastRenameAssociatedFile", false); pref("extensions.zotero.lastLongTagMode", 0); pref("extensions.zotero.lastLongTagDelimiter", ";");