Fix more Travis timeouts, hopefully

This commit is contained in:
Dan Stillman 2015-06-11 16:06:00 -04:00
parent 037bc07a3c
commit c407675d6a
2 changed files with 8 additions and 6 deletions

View file

@ -114,6 +114,7 @@ Zotero.CollectionTreeView.prototype.setTree = Zotero.Promise.coroutine(function*
if (!selected) { if (!selected) {
this.selection.select(0); this.selection.select(0);
} }
this.selection.selectEventsSuppressed = false;
yield this._runListeners('load'); yield this._runListeners('load');
this._initialized = true; this._initialized = true;
@ -129,9 +130,10 @@ Zotero.CollectionTreeView.prototype.setTree = Zotero.Promise.coroutine(function*
}); });
/* /**
* Reload the rows from the data access methods * Rebuild the tree from the data access methods and clear the selection
* (doesn't call the tree.invalidate methods, etc.) *
* Calling code must invalidate the tree, restore the selection, and unsuppress selection events
*/ */
Zotero.CollectionTreeView.prototype.refresh = Zotero.Promise.coroutine(function* () Zotero.CollectionTreeView.prototype.refresh = Zotero.Promise.coroutine(function* ()
{ {
@ -225,6 +227,7 @@ Zotero.CollectionTreeView.prototype.refresh = Zotero.Promise.coroutine(function*
} }
} }
this.selection.selectEventsSuppressed = true;
this.selection.clearSelection(); this.selection.clearSelection();
this._rows = newRows; this._rows = newRows;
this.rowCount = this._rows.length; this.rowCount = this._rows.length;

View file

@ -68,8 +68,7 @@ Zotero.ItemTreeView.prototype.type = 'item';
/** /**
* Called by the tree itself * Called by the tree itself
*/ */
Zotero.ItemTreeView.prototype.setTree = Zotero.serial(Zotero.Promise.coroutine(function* (treebox) Zotero.ItemTreeView.prototype.setTree = Zotero.Promise.coroutine(function* (treebox) {
{
try { try {
Zotero.debug("Setting tree for " + this.collectionTreeRow.id + " items view " + this.id); Zotero.debug("Setting tree for " + this.collectionTreeRow.id + " items view " + this.id);
var start = Date.now(); var start = Date.now();
@ -272,7 +271,7 @@ Zotero.ItemTreeView.prototype.setTree = Zotero.serial(Zotero.Promise.coroutine(f
} }
throw e; throw e;
} }
})); });
/** /**