mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
dragover on personal toolbar.
This commit is contained in:
parent
122f2d8f5a
commit
37806a44b8
@ -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)
|
||||
{
|
||||
|
@ -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" />
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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" />
|
||||
|
Loading…
Reference in New Issue
Block a user