Fix various things I broke (empty collections, auto-selection of new items, editing of inline attachment notes)

This commit is contained in:
Dan Stillman 2007-01-03 07:45:32 +00:00
parent 1b675ecc7e
commit b9f036e5f1
2 changed files with 12 additions and 4 deletions

View File

@ -1188,8 +1188,12 @@ Zotero.Item.prototype.getNotes = function(){
* Return true if a note item is an abstract, false otherwise
*/
Zotero.Item.prototype.isAbstract = function() {
if (this.isAttachment()) {
return false;
}
if (!this.isNote()) {
throw ("getAbstract() can only be called on note items");
throw ("isAbstract() can only be called on note items");
}
if (!this.getID()) {

View File

@ -691,8 +691,8 @@ Zotero.ItemTreeView.prototype.setFilter = function(type, data) {
this.sort();
this.rememberOpenState(savedOpenState);
this.rememberSelection(savedSelection);
this.rememberFirstRow(savedFirstRow);
this.rememberSelection(savedSelection);
this.selection.selectEventsSuppressed = false;
this._treebox.invalidate();
//Zotero.debug('Running callbacks in itemTreeView.setFilter()', 4);
@ -818,12 +818,16 @@ Zotero.ItemTreeView.prototype.rememberOpenState = function(ids) {
Zotero.ItemTreeView.prototype.saveFirstRow = function() {
return this._getItemAtRow(this._treebox.getFirstVisibleRow()).ref.getID();
var row = this._treebox.getFirstVisibleRow();
if (row) {
return this._getItemAtRow(row).ref.getID();
}
return false;
}
Zotero.ItemTreeView.prototype.rememberFirstRow = function(firstRow) {
if (this._itemRowMap[firstRow]) {
if (firstRow && this._itemRowMap[firstRow]) {
this._treebox.scrollToRow(this._itemRowMap[firstRow]);
}
}