Metadata pane tab fixes

- Connect tabs to pane
- Allow switching between metadata pane tabs using standard Firefox shortcuts (Ctrl-Tab, Ctrl-Shift-Tab)
- Fixed squished look in Firefox 3.5
- Remove some unnecessary padding, providing a little bit more room in the metadata pane

Needs a little testing

Closes #711, Improve keyboard support
This commit is contained in:
Dan Stillman 2009-07-03 11:11:13 +00:00
parent 37abd1658a
commit 4e3b79f9bb
5 changed files with 53 additions and 39 deletions

View file

@ -30,7 +30,6 @@ var ZoteroItemPane = new function() {
var _lastPane; var _lastPane;
var _loaded; var _loaded;
var _tabs;
var _lastTabIndex; var _lastTabIndex;
var _tabDirection; var _tabDirection;
var _tabIndexMaxTagsFields = 0; var _tabIndexMaxTagsFields = 0;
@ -51,10 +50,8 @@ var ZoteroItemPane = new function() {
return; return;
} }
_tabs = document.getElementById('zotero-view-tabs');
// Not in item pane, so skip the introductions // Not in item pane, so skip the introductions
if (!_tabs) { if (!document.getElementById('zotero-view-tabbox')) {
return; return;
} }

View file

@ -31,10 +31,12 @@
<script src="include.js"/> <script src="include.js"/>
<script src="itemPane.js"/> <script src="itemPane.js"/>
<deck id="zotero-view-item" flex="1" onselect="if (this.selectedIndex !== '') { ZoteroItemPane.loadPane(this.selectedIndex); }"> <tabpanels id="zotero-view-item" flex="1" oncommand="if (this.selectedIndex !== '') { ZoteroItemPane.loadPane(this.selectedIndex); }">
<tabpanel>
<zoteroitembox id="zotero-editpane-item-box" flex="1"/> <zoteroitembox id="zotero-editpane-item-box" flex="1"/>
</tabpanel>
<vbox flex="1"> <tabpanel flex="1" align="top">
<hbox align="center"> <hbox align="center">
<label id="zotero-editpane-notes-label"/> <label id="zotero-editpane-notes-label"/>
<button label="&zotero.item.add;" oncommand="ZoteroItemPane.addNote();"/> <button label="&zotero.item.add;" oncommand="ZoteroItemPane.addNote();"/>
@ -46,9 +48,9 @@
</columns> </columns>
<rows id="zotero-editpane-dynamic-notes" flex="1"/> <rows id="zotero-editpane-dynamic-notes" flex="1"/>
</grid> </grid>
</vbox> </tabpanel>
<vbox flex="1"> <tabpanel flex="1" align="top">
<hbox align="center"> <hbox align="center">
<label id="zotero-editpane-attachments-label"/> <label id="zotero-editpane-attachments-label"/>
<button id="zotero-tb-item-attachments-add" type="menu" label="&zotero.item.add;"> <button id="zotero-tb-item-attachments-add" type="menu" label="&zotero.item.add;">
@ -67,10 +69,14 @@
</columns> </columns>
<rows id="zotero-editpane-dynamic-attachments" flex="1"/> <rows id="zotero-editpane-dynamic-attachments" flex="1"/>
</grid> </grid>
</vbox> </tabpanel>
<tabpanel>
<tagsbox id="zotero-editpane-tags" flex="1"/> <tagsbox id="zotero-editpane-tags" flex="1"/>
</tabpanel>
<tabpanel>
<seealsobox id="zotero-editpane-related" flex="1"/> <seealsobox id="zotero-editpane-related" flex="1"/>
</deck> </tabpanel>
</tabpanels>
</overlay> </overlay>

View file

@ -991,15 +991,13 @@ var ZoteroPane = new function()
document.getElementById('zotero-item-restore-button').hidden = true; document.getElementById('zotero-item-restore-button').hidden = true;
} }
var tabs = document.getElementById('zotero-view-tabs'); var tabs = document.getElementById('zotero-view-tabbox');
if (this.itemsView && this.itemsView.selection.count == 1 && this.itemsView.selection.currentIndex != -1) if (this.itemsView && this.itemsView.selection.count == 1 && this.itemsView.selection.currentIndex != -1)
{ {
var item = this.itemsView._getItemAtRow(this.itemsView.selection.currentIndex); var item = this.itemsView._getItemAtRow(this.itemsView.selection.currentIndex);
if(item.ref.isNote()) { if(item.ref.isNote()) {
tabs.hidden = true;
var noteEditor = document.getElementById('zotero-note-editor'); var noteEditor = document.getElementById('zotero-note-editor');
noteEditor.mode = this.collectionsView.editable ? 'edit' : 'view'; noteEditor.mode = this.collectionsView.editable ? 'edit' : 'view';
@ -1033,8 +1031,6 @@ var ZoteroPane = new function()
} }
else if(item.ref.isAttachment()) { else if(item.ref.isAttachment()) {
tabs.hidden = true;
var attachmentBox = document.getElementById('zotero-attachment-box'); var attachmentBox = document.getElementById('zotero-attachment-box');
attachmentBox.mode = this.collectionsView.editable ? 'edit' : 'view'; attachmentBox.mode = this.collectionsView.editable ? 'edit' : 'view';
attachmentBox.item = item.ref; attachmentBox.item = item.ref;
@ -1049,18 +1045,15 @@ var ZoteroPane = new function()
if (this.collectionsView.editable) { if (this.collectionsView.editable) {
ZoteroItemPane.viewItem(item.ref); ZoteroItemPane.viewItem(item.ref);
tabs.selectedIndex = document.getElementById('zotero-view-item').selectedIndex; tabs.selectedIndex = document.getElementById('zotero-view-item').selectedIndex;
tabs.hidden = false;
} }
else { else {
document.getElementById('zotero-view-item').selectedIndex = 0; document.getElementById('zotero-view-item').selectedIndex = 0;
ZoteroItemPane.viewItem(item.ref, 'view'); ZoteroItemPane.viewItem(item.ref, 'view');
tabs.hidden = true;
} }
} }
} }
else else
{ {
tabs.hidden = true;
document.getElementById('zotero-item-pane-content').selectedIndex = 0; document.getElementById('zotero-item-pane-content').selectedIndex = 0;
var label = document.getElementById('zotero-view-selected-label'); var label = document.getElementById('zotero-view-selected-label');

View file

@ -370,30 +370,30 @@
<!-- TODO: localize --> <!-- TODO: localize -->
<button id="zotero-item-restore-button" label="Restore to Library" <button id="zotero-item-restore-button" label="Restore to Library"
oncommand="ZoteroPane.restoreSelectedItems()" hidden="true"/> oncommand="ZoteroPane.restoreSelectedItems()" hidden="true"/>
<groupbox flex="1"> <deck id="zotero-item-pane-content" selectedIndex="0" flex="1">
<caption> <groupbox pack="center" align="center">
<tabs id="zotero-view-tabs" onselect="document.getElementById('zotero-view-item').selectedIndex = this.selectedIndex;" hidden="true"> <label id="zotero-view-selected-label"/>
</groupbox>
<tabbox id="zotero-view-tabbox">
<tabs>
<tab label="&zotero.tabs.info.label;"/> <tab label="&zotero.tabs.info.label;"/>
<tab label="&zotero.tabs.notes.label;"/> <tab label="&zotero.tabs.notes.label;"/>
<tab label="&zotero.tabs.attachments.label;"/> <tab label="&zotero.tabs.attachments.label;"/>
<tab label="&zotero.tabs.tags.label;"/> <tab label="&zotero.tabs.tags.label;"/>
<tab label="&zotero.tabs.related.label;"/> <tab label="&zotero.tabs.related.label;"/>
</tabs> </tabs>
</caption> <tabpanels id="zotero-view-item" flex="1"/>
<deck id="zotero-item-pane-content" selectedIndex="0" flex="1"> </tabbox>
<box pack="center" align="center">
<label id="zotero-view-selected-label"/>
</box>
<deck id="zotero-view-item" flex="1"/>
<!-- Note info pane --> <!-- Note info pane -->
<vbox id="zotero-view-note" flex="1"> <groupbox id="zotero-view-note" flex="1">
<zoteronoteeditor id="zotero-note-editor" flex="1"/> <zoteronoteeditor id="zotero-note-editor" flex="1"/>
<button id="zotero-view-note-button" label="&zotero.notes.separate;" oncommand="ZoteroPane.openNoteWindow(this.getAttribute('noteID')); if(this.hasAttribute('sourceID')) ZoteroPane.selectItem(this.getAttribute('sourceID'));"/> <button id="zotero-view-note-button" label="&zotero.notes.separate;" oncommand="ZoteroPane.openNoteWindow(this.getAttribute('noteID')); if(this.hasAttribute('sourceID')) ZoteroPane.selectItem(this.getAttribute('sourceID'));"/>
</vbox>
<!-- Attachment info pane -->
<zoteroattachmentbox id="zotero-attachment-box" flex="1"/>
</deck>
</groupbox> </groupbox>
<!-- Attachment info pane -->
<groupbox flex="1">
<zoteroattachmentbox id="zotero-attachment-box" flex="1"/>
</groupbox>
</deck>
</vbox> </vbox>
</hbox> </hbox>

View file

@ -289,8 +289,26 @@ window[active="true"] #zotero-pane[fullscreenmode="true"][platform="mac"]
list-style-image: url('chrome://zotero/skin/search-cancel-active.png'); list-style-image: url('chrome://zotero/skin/search-cancel-active.png');
} }
#zotero-view-tabs tab #zotero-view-tabbox, #zotero-item-pane-content > groupbox
{ {
margin: 0;
}
#zotero-view-tabbox tabs tab
{
margin-top: 0 !important;
margin-bottom: 0 !important;
}
#zotero-view-tabbox tabs tab .tab-text
{
margin-top: .2em !important;
margin-bottom: .25em !important;
}
#zotero-view-item
{
padding: 1.5em .25em .25em;
} }
#zotero-view-item > vbox #zotero-view-item > vbox