diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js index 8f8abb62c..c8d2f44d9 100644 --- a/chrome/content/zotero/overlay.js +++ b/chrome/content/zotero/overlay.js @@ -585,6 +585,7 @@ var ZoteroPane = new function() this.itemsView = new Zotero.ItemTreeView(itemgroup); this.itemsView.addCallback(_setTagScope); document.getElementById('zotero-items-tree').view = this.itemsView; + Zotero.debug('crashdebug6'); this.itemsView.selection.clearSelection(); Zotero.UnresponsiveScriptIndicator.enable(); } diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js index 830b45518..e15965138 100644 --- a/chrome/content/zotero/xpcom/itemTreeView.js +++ b/chrome/content/zotero/xpcom/itemTreeView.js @@ -400,11 +400,13 @@ Zotero.ItemTreeView.prototype.notify = function(action, type, ids) this._refreshHashMap(); } - this.rememberSelection(savedSelection); - if (activeWindow) { this.selectItem(ids[0]); } + else { + Zotero.debug('crashdebug1'); + this.rememberSelection(savedSelection); + } } else { @@ -414,7 +416,7 @@ Zotero.ItemTreeView.prototype.notify = function(action, type, ids) else { this._refreshHashMap(); } - + Zotero.debug('crashdebug2') this.rememberSelection(savedSelection); } @@ -610,6 +612,7 @@ Zotero.ItemTreeView.prototype.cycleHeader = function(column) this.selection.selectEventsSuppressed = true; var savedSelection = this.saveSelection(); this.sort(); + Zotero.debug('crashdebug3') this.rememberSelection(savedSelection); this.selection.selectEventsSuppressed = false; this._treebox.invalidate(); @@ -983,6 +986,7 @@ Zotero.ItemTreeView.prototype.setFilter = function(type, data) { this.rememberOpenState(savedOpenState); this.rememberFirstRow(savedFirstRow); + Zotero.debug('crashdebug4') this.rememberSelection(savedSelection); this.selection.selectEventsSuppressed = false; this._treebox.invalidate(); @@ -1062,13 +1066,8 @@ Zotero.ItemTreeView.prototype.saveSelection = function() */ Zotero.ItemTreeView.prototype.rememberSelection = function(selection) { - // clearSelection() seems to cause a crash in Firefox 2.0.0.2 - 2.0.0.3, at least - //this.selection.clearSelection(); - // So try this alternative method - this.selection.selectEventsSuppressed = true; - this.selection.select(0); - this.selection.toggleSelect(0); - this.selection.selectEventsSuppressed = false; + // DEBUG: This seems to occasionally cause a crash + this.selection.clearSelection(); for(var i=0; i < selection.length; i++) {