From eba2974ce18404466772992fc38458904e6bd32b Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 8 Sep 2006 01:23:22 +0000 Subject: [PATCH] Fixes #251, UI refresh problem with page snapshot Also fixes snapshot add breakage when another tab is selected caused by blur() fix from other day --- chrome/chromeFiles/content/scholar/itemPane.js | 2 +- chrome/chromeFiles/content/scholar/xpcom/itemTreeView.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/chrome/chromeFiles/content/scholar/itemPane.js b/chrome/chromeFiles/content/scholar/itemPane.js index 5a765dc509..75aba60c45 100644 --- a/chrome/chromeFiles/content/scholar/itemPane.js +++ b/chrome/chromeFiles/content/scholar/itemPane.js @@ -108,7 +108,7 @@ var ScholarItemPane = new function() break; } - if (boxes.length==1) + if (boxes && boxes.length==1) { boxes[0].inputField.blur(); } diff --git a/chrome/chromeFiles/content/scholar/xpcom/itemTreeView.js b/chrome/chromeFiles/content/scholar/xpcom/itemTreeView.js index ac934bfba8..ddb0654a25 100644 --- a/chrome/chromeFiles/content/scholar/xpcom/itemTreeView.js +++ b/chrome/chromeFiles/content/scholar/xpcom/itemTreeView.js @@ -176,6 +176,10 @@ Scholar.ItemTreeView.prototype.notify = function(action, type, ids) if(action == 'add') { if (ids.length===1){ + // Reset to Info tab + this._treebox.treeBody.ownerDocument. + getElementById('scholar-view-tabs').selectedIndex = 0; + this.selectItem(ids[0]); } }