diff --git a/chrome/chromeFiles/content/scholar/overlay.js b/chrome/chromeFiles/content/scholar/overlay.js index 8a5166a38..ef6c6ec74 100644 --- a/chrome/chromeFiles/content/scholar/overlay.js +++ b/chrome/chromeFiles/content/scholar/overlay.js @@ -139,12 +139,6 @@ var ScholarPane = new function() */ function newItem(typeID) { - if(document.getElementById('tb-search').value != "") - { - document.getElementById('tb-search').value = ""; - document.getElementById('tb-search').doCommand(); - } - var item = new Scholar.Item(typeID); item.save(); if(itemsView && itemsView._itemGroup.isCollection()) diff --git a/chrome/chromeFiles/content/scholar/xpcom/itemTreeView.js b/chrome/chromeFiles/content/scholar/xpcom/itemTreeView.js index ddb0654a2..59af52df0 100644 --- a/chrome/chromeFiles/content/scholar/xpcom/itemTreeView.js +++ b/chrome/chromeFiles/content/scholar/xpcom/itemTreeView.js @@ -74,12 +74,21 @@ Scholar.ItemTreeView.prototype.refresh = function() Scholar.ItemTreeView.prototype.notify = function(action, type, ids) { var madeChanges = false; - this.selection.selectEventsSuppressed = true; var savedSelection = this.saveSelection(); ids = Scholar.flattenArguments(ids); + // See if we're in the active window + var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] + .getService(Components.interfaces.nsIWindowMediator); + if (wm.getMostRecentWindow("navigator:browser") == + this._treebox.treeBody.ownerDocument.defaultView){ + var activeWindow = true; + } + + var quicksearch = this._treebox.treeBody.ownerDocument.getElementById('tb-search'); + if((action == 'remove' && !this._itemGroup.isLibrary()) || (action == 'delete' && this._itemGroup.isLibrary())) { //Since a remove involves shifting of rows, we have to do it in order @@ -110,55 +119,82 @@ Scholar.ItemTreeView.prototype.notify = function(action, type, ids) } else if(action == 'modify') //must check for null because it could legitimately be 0 { - for(var i=0, len=ids.length; i