bug80876 Drag and Drop doesn't work in the address book,r=naving,sr=sspitzer

This commit is contained in:
chuang%netscape.com 2001-05-17 03:28:44 +00:00
parent d0b42c2fd5
commit d7bdf138d3

View File

@ -23,7 +23,7 @@
function debugDump(msg) function debugDump(msg)
{ {
// uncomment for noise // uncomment for noise
dump(msg+"\n"); // dump(msg+"\n");
} }
function GetDragService() function GetDragService()
@ -35,15 +35,6 @@ function GetDragService()
return dragService; return dragService;
} }
function GetRDFService()
{
var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService();
if (rdf)
rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
return rdf;
}
function DragOverTree(event) function DragOverTree(event)
{ {
var validFlavor = false; var validFlavor = false;
@ -88,15 +79,7 @@ function BeginDragResultTree(event)
var tree = resultsTree; var tree = resultsTree;
if ( event.target == tree ) if ( event.target == tree )
return(true); // continue propagating the event return(true); // continue propagating the event
var childWithDatabase = tree;
if ( ! childWithDatabase )
return(false);
var database = childWithDatabase.database;
var rdf = GetRDFService();
if ((!rdf) || (!database)) { debugDump("CAN'T GET DATABASE\n"); return(false); }
var dragStarted = false; var dragStarted = false;
var dragService = GetDragService(); var dragService = GetDragService();
@ -146,7 +129,7 @@ function DropOnDirectoryTree(event)
event.target.localName != "treeitem") event.target.localName != "treeitem")
return false; return false;
var RDF = GetRDFService(); var RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService().QueryInterface(Components.interfaces.nsIRDFService);
if (!RDF) return(false); if (!RDF) return(false);
var treeRoot = dirTree; var treeRoot = dirTree;