Fix various things I broke (empty collections, auto-selection of new items, editing of inline attachment notes)
This commit is contained in:
parent
1b675ecc7e
commit
b9f036e5f1
|
@ -1188,8 +1188,12 @@ Zotero.Item.prototype.getNotes = function(){
|
||||||
* Return true if a note item is an abstract, false otherwise
|
* Return true if a note item is an abstract, false otherwise
|
||||||
*/
|
*/
|
||||||
Zotero.Item.prototype.isAbstract = function() {
|
Zotero.Item.prototype.isAbstract = function() {
|
||||||
|
if (this.isAttachment()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.isNote()) {
|
if (!this.isNote()) {
|
||||||
throw ("getAbstract() can only be called on note items");
|
throw ("isAbstract() can only be called on note items");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.getID()) {
|
if (!this.getID()) {
|
||||||
|
|
|
@ -691,8 +691,8 @@ Zotero.ItemTreeView.prototype.setFilter = function(type, data) {
|
||||||
this.sort();
|
this.sort();
|
||||||
|
|
||||||
this.rememberOpenState(savedOpenState);
|
this.rememberOpenState(savedOpenState);
|
||||||
this.rememberSelection(savedSelection);
|
|
||||||
this.rememberFirstRow(savedFirstRow);
|
this.rememberFirstRow(savedFirstRow);
|
||||||
|
this.rememberSelection(savedSelection);
|
||||||
this.selection.selectEventsSuppressed = false;
|
this.selection.selectEventsSuppressed = false;
|
||||||
this._treebox.invalidate();
|
this._treebox.invalidate();
|
||||||
//Zotero.debug('Running callbacks in itemTreeView.setFilter()', 4);
|
//Zotero.debug('Running callbacks in itemTreeView.setFilter()', 4);
|
||||||
|
@ -818,12 +818,16 @@ Zotero.ItemTreeView.prototype.rememberOpenState = function(ids) {
|
||||||
|
|
||||||
|
|
||||||
Zotero.ItemTreeView.prototype.saveFirstRow = function() {
|
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) {
|
Zotero.ItemTreeView.prototype.rememberFirstRow = function(firstRow) {
|
||||||
if (this._itemRowMap[firstRow]) {
|
if (firstRow && this._itemRowMap[firstRow]) {
|
||||||
this._treebox.scrollToRow(this._itemRowMap[firstRow]);
|
this._treebox.scrollToRow(this._itemRowMap[firstRow]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user