mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
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:
parent
d51644d159
commit
dab0e1f45e
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user