Fixes #347, Dragging a URL over the Zotero pane (even without releasing) throws an SQL error

x-moz-url was listed as a supported flavour in both panes but not actually supported

Also fixed a typo (= instead of ==) in collectionTreeView's canDrop()
This commit is contained in:
Dan Stillman 2006-12-26 07:27:34 +00:00
parent 36d6ff58b8
commit c2858475a8
2 changed files with 11 additions and 5 deletions

View File

@ -510,7 +510,8 @@ Zotero.CollectionTreeView.prototype.canDrop = function(row, orient)
{
var rowCollection = this._getItemAtRow(row).ref; //the collection we are dragging over
if(dataType == 'zotero/item' || dataType == "text/x-moz-url")
// TODO: Dragging URLs not yet supported
if (dataType == 'zotero/item' || dataType == "text/x-moz-url")
{
var ids = data.data.split(',');
for each(var id in ids)
@ -529,8 +530,11 @@ Zotero.CollectionTreeView.prototype.canDrop = function(row, orient)
}
return false;
}
else if(dataType='zotero/collection' && data.data != rowCollection.getID() && !Zotero.Collections.get(data.data).hasDescendent('collection',rowCollection.getID()) )
return true; //collections cannot be dropped on themselves, nor in their children
else if (dataType == 'zotero/collection'
&& data.data != rowCollection.getID()
&& !Zotero.Collections.get(data.data).hasDescendent('collection', rowCollection.getID())) {
return true;//collections cannot be dropped on themselves, nor in their children
}
}
return false;
}
@ -608,7 +612,8 @@ Zotero.CollectionTreeView.prototype.onDragStart = function(evt,transferData,acti
Zotero.CollectionTreeView.prototype.getSupportedFlavours = function ()
{
var flavors = new FlavourSet();
flavors.appendFlavour("text/x-moz-url");
// TODO: Dragging of URLs not yet supported
//flavors.appendFlavour("text/x-moz-url");
flavors.appendFlavour("zotero/item");
flavors.appendFlavour("zotero/collection");
return flavors;

View File

@ -836,7 +836,8 @@ Zotero.ItemTreeView.prototype.getSupportedFlavours = function ()
{
var flavors = new FlavourSet();
flavors.appendFlavour("zotero/item");
flavors.appendFlavour("text/x-moz-url");
// TODO: Dragging of URLs not yet supported
//flavors.appendFlavour("text/x-moz-url");
return flavors;
}