add text/plain flavor acceptance to dragOver on personal toolbar and set canDrop on drag session so win32 uses the correct cursor feedback. (r=saari).

This commit is contained in:
pinkerton%netscape.com 1999-11-02 21:28:14 +00:00
parent d51644d159
commit dab0e1f45e
2 changed files with 24 additions and 16 deletions

View File

@ -189,23 +189,27 @@ this doesn't work anymore (target is null), not sure why.
function DragOverPersonalToolbar ( event )
{
var validFlavor = false;
var dragSession = null;
var dragService = Components.classes["component://netscape/widget/dragservice"].getService();
if ( dragService ) dragService = dragService.QueryInterface(Components.interfaces.nsIDragService);
if ( dragService ) {
var dragSession = dragService.getCurrentSession();
dragSession = dragService.getCurrentSession();
if ( dragSession ) {
if ( dragSession.isDataFlavorSupported("moz/toolbaritem") )
validFlavor = true;
else if ( dragSession.isDataFlavorSupported("text/plain") )
validFlavor = true;
//XXX other flavors here...
}
}
// touch the attribute to trigger the repaint with the drop feedback.
if ( validFlavor ) {
//XXX this is really slow and likes to refresh N times per second.
var toolbar = document.getElementById("PersonalToolbar");
toolbar.setAttribute ( "tb-triggerrepaint", 0 );
// touch the attribute to trigger the repaint with the drop feedback.
if ( validFlavor ) {
//XXX this is really slow and likes to refresh N times per second.
var toolbar = document.getElementById("PersonalToolbar");
toolbar.setAttribute ( "tb-triggerrepaint", 0 );
dragSession.canDrop = true;
}
}
}
return true;

View File

@ -189,23 +189,27 @@ this doesn't work anymore (target is null), not sure why.
function DragOverPersonalToolbar ( event )
{
var validFlavor = false;
var dragSession = null;
var dragService = Components.classes["component://netscape/widget/dragservice"].getService();
if ( dragService ) dragService = dragService.QueryInterface(Components.interfaces.nsIDragService);
if ( dragService ) {
var dragSession = dragService.getCurrentSession();
dragSession = dragService.getCurrentSession();
if ( dragSession ) {
if ( dragSession.isDataFlavorSupported("moz/toolbaritem") )
validFlavor = true;
else if ( dragSession.isDataFlavorSupported("text/plain") )
validFlavor = true;
//XXX other flavors here...
}
}
// touch the attribute to trigger the repaint with the drop feedback.
if ( validFlavor ) {
//XXX this is really slow and likes to refresh N times per second.
var toolbar = document.getElementById("PersonalToolbar");
toolbar.setAttribute ( "tb-triggerrepaint", 0 );
// touch the attribute to trigger the repaint with the drop feedback.
if ( validFlavor ) {
//XXX this is really slow and likes to refresh N times per second.
var toolbar = document.getElementById("PersonalToolbar");
toolbar.setAttribute ( "tb-triggerrepaint", 0 );
dragSession.canDrop = true;
}
}
}
return true;