Addresses #85, Button(s) to expand/collapse all notes in a view

Enable expand/collapse in advanced search window
This commit is contained in:
Dan Stillman 2007-02-18 11:23:23 +00:00
parent 4740d85d49
commit 5d638df73a
3 changed files with 18 additions and 1 deletions

View File

@ -3,6 +3,7 @@ var ZoteroAdvancedSearch = new function() {
this.search = search;
this.clear = clear;
this.save = save;
this.handleKeyPress = handleKeyPress;
this.onDblClick = onDblClick;
this.onUnload = onUnload;
@ -86,6 +87,22 @@ var ZoteroAdvancedSearch = new function() {
}
function handleKeyPress(event) {
var key = String.fromCharCode(event.which);
if (key == '+' && !(event.ctrlKey || event.altKey || event.metaKey)) {
this.itemsView.expandAllRows();
return;
}
else if (key == '-' && !(event.shiftKey || event.ctrlKey ||
event.altKey || event.metaKey)) {
this.itemsView.collapseAllRows();
return;
}
}
// Adapted from: http://www.xulplanet.com/references/elemref/ref_tree.html#cmnote-9
function onDblClick(event, tree)
{

View File

@ -37,6 +37,7 @@
</hbox>
<tree id="zotero-items-tree" flex="1" hidecolumnpicker="true" seltype="multiple"
onkeypress="ZoteroAdvancedSearch.handleKeyPress(event)"
ondblclick="ZoteroAdvancedSearch.onDblClick(event, this)"
ondraggesture="if (event.target.localName == 'treechildren') { nsDragAndDrop.startDrag(event, ZoteroAdvancedSearch.itemsView); }">
<treecols>

View File

@ -369,7 +369,6 @@ var ZoteroPane = new function()
return;
}
}
}