zotero/chrome/chromeFiles/content/scholar/itemPane.xul
Dan Stillman 57f4e43507 OK, I think this should fix both #179 ("adding a new creator then clicking an existing creator makes the creator field disappear") and #190 ("tag issues") -- I caused #190 with my fix to the former, and David rebroke #179 with his revert to fix the latter.
The problem was twofold: 1) onselect="ScholarItemPane.loadPane(this.selectedIndex)" is (for some reason) triggered when clicking off of the "+" creator add button onto the rest of the deck pane (and not just when switching tabs) and 2) the selectedIndex passed into loadPane() from the deck during the non-tab triggers is (for some reason) an empty string rather than the index of the selected tab, which is why the creator problem only used to happen the first time you clicked away from a "+" (before the empty string was stored as a key in the _loaded array). (In short, onselect for decks is pretty broken.)

Now only calling loadPane if (this.selectedIndex!=='') -- can't just test for typeof=='number' because this.selectedIndex on the deck is always a string


refs #179 and #190
2006-08-22 07:01:21 +00:00

88 lines
No EOL
3.6 KiB
XML

<?xml version="1.0"?>
<!--
Scholar
Copyright (C) 2006 Center for History and New Media, George Mason University, Fairfax, VA
http://chnm.gmu.edu/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-->
<!DOCTYPE window SYSTEM "chrome://scholar/locale/scholar.dtd">
<overlay
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="itemPane.js"/>
<deck id="scholar-view-item" flex="1" onselect="if (this.selectedIndex!==''){ ScholarItemPane.loadPane(this.selectedIndex) }">
<vbox id="scholar-info" flex="1">
<popupset>
<popup id="creatorTypeMenu" position="after_start"
oncommand="var otherFields = ScholarItemPane.getCreatorFields(document.popupNode.parentNode);
var typeID = event.explicitOriginalTarget.getAttribute('typeid');
document.popupNode.setAttribute('value',
Scholar.getString('creatorTypes.' + Scholar.CreatorTypes.getName(typeID)) + ':');
ScholarItemPane.modifyCreator(document.popupNode.getAttribute('fieldname').split('-')[1],
'typeID', typeID, otherFields)"/>
</popupset>
<hbox align="center">
<menulist id="editpane-type-menu" oncommand="ScholarItemPane.changeTypeTo(this.value)" flex="1">
<menupopup/>
</menulist>
<toolbarbutton id="tb-openurl" tooltiptext="&toolbar.openurl.label;" oncommand="ScholarItemPane.onOpenURLClick();"/>
</hbox>
<grid flex="1">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows id="editpane-dynamic-fields" flex="1"/>
</grid>
</vbox>
<vbox flex="1">
<hbox align="center">
<label id="editpane-notes-label"/>
<button label="&item.add;" oncommand="ScholarItemPane.addNote();"/>
</hbox>
<grid flex="1">
<columns>
<column flex="1"/>
<column/>
</columns>
<rows id="editpane-dynamic-notes" flex="1"/>
</grid>
</vbox>
<vbox flex="1">
<hbox align="center">
<label id="editpane-attachments-label"/>
<button id="tb-item-attachments-add" type="menu" label="&item.add;">
<menupopup>
<menuitem class="menuitem-iconic" id="tb-item-attachments-link" label="&toolbar.attachment.linked;" oncommand="ScholarItemPane.addAttachmentFromDialog(true);"/>
<menuitem class="menuitem-iconic" id="tb-item-attachments-file" label="&toolbar.attachment.add;" oncommand="ScholarItemPane.addAttachmentFromDialog();"/>
<menuitem class="menuitem-iconic" id="tb-item-attachments-web-link" label="&toolbar.attachment.weblink;" oncommand="ScholarItemPane.addAttachmentFromPage(true);"/>
<menuitem class="menuitem-iconic" id="tb-item-attachments-snapshot" label="&toolbar.attachment.snapshot;" oncommand="ScholarItemPane.addAttachmentFromPage();"/>
</menupopup>
</button>
</hbox>
<grid flex="1">
<columns>
<column flex="1"/>
<column/>
</columns>
<rows id="editpane-dynamic-attachments" flex="1"/>
</grid>
</vbox>
<tagsbox id="editpane-tags" flex="1"/>
<seealsobox id="editpane-related" flex="1"/>
</deck>
</overlay>