diff --git a/chrome/chromeFiles/content/scholar/folderTreeView.js b/chrome/chromeFiles/content/scholar/folderTreeView.js index ff534f214..960344fdf 100644 --- a/chrome/chromeFiles/content/scholar/folderTreeView.js +++ b/chrome/chromeFiles/content/scholar/folderTreeView.js @@ -29,8 +29,16 @@ Scholar.FolderTreeView.prototype.getCellText = function(row, column) return ""; } -Scholar.FolderTreeView.prototype.isContainer = function(row) { return this._getItemAtRow(row).isCollection(); } -Scholar.FolderTreeView.prototype.isContainerOpen = function(row) { return this._dataItems[row][1]; } +Scholar.FolderTreeView.prototype.isContainer = function(row) +{ + return this._getItemAtRow(row).isCollection(); +} + +Scholar.FolderTreeView.prototype.isContainerOpen = function(row) +{ + return this._dataItems[row][1]; +} + Scholar.FolderTreeView.prototype.isContainerEmpty = function(row) { var itemGroup = this._getItemAtRow(row); @@ -164,6 +172,23 @@ Scholar.FolderTreeView.prototype._refreshHashMap = function() //Scholar.debug(Scholar.varDump(this.objectRowMap)); } +Scholar.FolderTreeView.prototype.canDrop = function(row, orient) +{ + if(orient == this.DROP_ON && this._getItemAtRow(row).isCollection()) + return true; + else + return false; + +} + +Scholar.FolderTreeView.prototype.drop = function(row, orient) +{ + //you can't really do anything here, look to overlay.js - ScholarCollectionsDragObserver +} + +// +// SCHOLAR ITEMGROUP +// Scholar.ItemGroup = function(type, ref) { this.type = type; diff --git a/chrome/chromeFiles/content/scholar/itemTreeView.js b/chrome/chromeFiles/content/scholar/itemTreeView.js index e84216528..78d50711b 100644 --- a/chrome/chromeFiles/content/scholar/itemTreeView.js +++ b/chrome/chromeFiles/content/scholar/itemTreeView.js @@ -119,10 +119,10 @@ Scholar.ItemTreeView.prototype.deleteSelection = function() else if(this._itemGroup.isCollection()) this._itemGroup.ref.removeItem(this._getItemAtRow(rows[i]-i).getID()); - + /* Don't do this, the notifier tells us? //remove row from tree: this._hideItem(rows[i]-i); - this._treebox.rowCountChanged(rows[i]-i, -1); + this._treebox.rowCountChanged(rows[i]-i, -1); */ } this._treebox.endUpdateBatch(); @@ -159,36 +159,66 @@ Scholar.ItemTreeView.prototype.getCollectionID = function() Scholar.ItemTreeView.prototype.notify = function(action, type, ids) { ids = Scholar.flattenArguments(ids); + var madeChanges = false; - for (var i=0, len=ids.length; i 0) { - this._hideItem(row); - this._treebox.rowCountChanged(row,-1); - } - else if(action == 'modify' && row) - { - this._treebox.invalidateRow(row) - } - else if(action == 'add' && !row) - { - var item = Scholar.Items.get(ids[i]); + rows.sort(function(a,b) { return a-b }); - if(this._itemGroup.isLibrary() || item.inCollection(this.getCollectionID())) + for(var i=0, len=rows.length; i