mirror of
https://github.com/zotero/zotero.git
synced 2026-09-20 00:12:49 +00:00
Fixes #1816, Manually created items inherit creator field mode from last item selected
Update pref only when clicking the switch button
This commit is contained in:
parent
8bfe184998
commit
8c92603b88
1 changed files with 7 additions and 4 deletions
|
|
@ -749,6 +749,7 @@
|
|||
<parameter name="row"/>
|
||||
<parameter name="fieldMode"/>
|
||||
<parameter name="initial"/>
|
||||
<parameter name="updatePref"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
// Change if button position changes
|
||||
|
|
@ -764,7 +765,7 @@
|
|||
button.style.backgroundImage = 'url("chrome://zotero/skin/textfield-dual.png")';
|
||||
button.setAttribute('tooltiptext', Zotero.getString('pane.item.switchFieldMode.two'));
|
||||
lastName.setAttribute('fieldMode', '1');
|
||||
button.setAttribute('onclick', "document.getBindingParent(this).switchCreatorMode(Zotero.getAncestorByTagName(this, 'row'), 0)");
|
||||
button.setAttribute('onclick', "document.getBindingParent(this).switchCreatorMode(Zotero.getAncestorByTagName(this, 'row'), 0, false, true)");
|
||||
lastName.setAttribute('flex', '1');
|
||||
delete lastName.style.width;
|
||||
delete lastName.style.maxWidth;
|
||||
|
|
@ -797,7 +798,7 @@
|
|||
button.style.backgroundImage = 'url("chrome://zotero/skin/textfield-single.png")';
|
||||
button.setAttribute('tooltiptext', Zotero.getString('pane.item.switchFieldMode.one'));
|
||||
lastName.setAttribute('fieldMode', '0');
|
||||
button.setAttribute('onclick', "document.getBindingParent(this).switchCreatorMode(Zotero.getAncestorByTagName(this, 'row'), 1)");
|
||||
button.setAttribute('onclick', "document.getBindingParent(this).switchCreatorMode(Zotero.getAncestorByTagName(this, 'row'), 1, false, true)");
|
||||
lastName.setAttribute('flex', '0');
|
||||
|
||||
// appropriately truncate lastName
|
||||
|
|
@ -863,8 +864,10 @@
|
|||
}
|
||||
|
||||
// Save the last-used field mode
|
||||
Zotero.debug("Switching lastCreatorFieldMode to " + fieldMode);
|
||||
Zotero.Prefs.set('lastCreatorFieldMode', fieldMode);
|
||||
if (updatePref) {
|
||||
Zotero.debug("Switching lastCreatorFieldMode to " + fieldMode);
|
||||
Zotero.Prefs.set('lastCreatorFieldMode', fieldMode);
|
||||
}
|
||||
|
||||
if (!initial)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue