Addresses #85, Button(s) to expand/collapse all notes in a view
Enable expand/collapse in advanced search window
This commit is contained in:
parent
4740d85d49
commit
5d638df73a
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -369,7 +369,6 @@ var ZoteroPane = new function()
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user