dragover on personal toolbar.

This commit is contained in:
pinkerton%netscape.com 1999-09-09 06:27:43 +00:00
parent 122f2d8f5a
commit 37806a44b8
4 changed files with 58 additions and 2 deletions

View File

@ -110,6 +110,33 @@
} // DropPersonalToolbar
function DragOverPersonalToolbar ( event )
{
var validFlavor = false;
var dragService = Components.classes["component://netscape/widget/dragservice"].getService();
if ( dragService ) dragService = dragService.QueryInterface(Components.interfaces.nsIDragService);
if ( dragService ) {
var dragSession = dragService.getCurrentSession();
if ( dragSession ) {
if ( dragSession.isDataFlavorSupported("mozilla/toolbaritem") )
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 );
}
return true;
} // DragOverPersonalToolbar
function UpdateHistory(event)
{

View File

@ -457,7 +457,8 @@ Contributor(s): ______________________________________. -->
</toolbar>
<toolbar class="main-bar" chromeclass="toolbar" datasources="rdf:bookmarks" id="PersonalToolbar" ref="NC:PersonalToolbarFolder"
ondraggesture="return BeginDragPersonalToolbar(event);" ondragdrop="return DropPersonalToolbar(event);">
ondraggesture="return BeginDragPersonalToolbar(event);" ondragdrop="return DropPersonalToolbar(event);"
ondragover="return DragOverPersonalToolbar(event);">
<template>
<rule iscontainer="true">
<titledbutton uri="..." src="resource:/res/rdf/folder-closed.gif" value="rdf:http://home.netscape.com/NC-rdf#Name" align="left" popup="bookmark-popup" />

View File

@ -110,6 +110,33 @@
} // DropPersonalToolbar
function DragOverPersonalToolbar ( event )
{
var validFlavor = false;
var dragService = Components.classes["component://netscape/widget/dragservice"].getService();
if ( dragService ) dragService = dragService.QueryInterface(Components.interfaces.nsIDragService);
if ( dragService ) {
var dragSession = dragService.getCurrentSession();
if ( dragSession ) {
if ( dragSession.isDataFlavorSupported("mozilla/toolbaritem") )
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 );
}
return true;
} // DragOverPersonalToolbar
function UpdateHistory(event)
{

View File

@ -457,7 +457,8 @@ Contributor(s): ______________________________________. -->
</toolbar>
<toolbar class="main-bar" chromeclass="toolbar" datasources="rdf:bookmarks" id="PersonalToolbar" ref="NC:PersonalToolbarFolder"
ondraggesture="return BeginDragPersonalToolbar(event);" ondragdrop="return DropPersonalToolbar(event);">
ondraggesture="return BeginDragPersonalToolbar(event);" ondragdrop="return DropPersonalToolbar(event);"
ondragover="return DragOverPersonalToolbar(event);">
<template>
<rule iscontainer="true">
<titledbutton uri="..." src="resource:/res/rdf/folder-closed.gif" value="rdf:http://home.netscape.com/NC-rdf#Name" align="left" popup="bookmark-popup" />