Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Prevent Firefox from using dropped data as a URL

1 view
Skip to first unread message

Susan Crayne

unread,
Nov 9, 2009, 4:09:53 PM11/9/09
to
I'm running Firefox 3.5.4 on Windows Vista. We have developed an addon the
UI of which sits inside a popup. I'm implementing a function that will
allow users to drag the UI window to any place on the browser, using the XUL
drag and drop functionality.

The problem is that the drag and dragover functions work correctly, but
the browser takes over the drop and puts my data into the URL bar. I
actually don't need to transfer any data -- I just need to get the mouse
coordinates of the place where the dragged window is dropped. But if I
don't transfer any data, the drag doesn't happen. I put in dummy data, and
my onDrop handler never gets called, so that I can't get the final the mouse
coordinates. I have put (event.preventDefault()) into my onDrop handler,
but that doesn't seem to work.

I''m thinking about giving up on drag and drop, and implementing my own
using mouse events. But I'd like to have the nice drag image capability
that drag and drop provides. I'd be grateful for any help.

Thanks.

Susan

Neil Deakin

unread,
Nov 9, 2009, 5:18:59 PM11/9/09
to
Susan Crayne wrote:
> I'm running Firefox 3.5.4 on Windows Vista. We have developed an addon
> the UI of which sits inside a popup. I'm implementing a function that
> will allow users to drag the UI window to any place on the browser,
> using the XUL drag and drop functionality.
>

Dragging windows around should just be done with the <titlebar> element.

Susan Crayne

unread,
Nov 9, 2009, 11:16:41 PM11/9/09
to
This is a XUL panel. It does not have a title bar.

"Neil Deakin" <ennd...@sympatico.ca> wrote in message
news:oPydnXVE_fbOCGXX...@mozilla.org...

Neil Deakin

unread,
Nov 10, 2009, 8:23:20 AM11/10/09
to
Susan Crayne wrote:
> This is a XUL panel. It does not have a title bar.
>

No, I meant you should add a <titlebar> element yourself. It doesn't
have to look like one though.

You certainly shouldn't be using the drag and drop api for this.

Susan Crayne

unread,
Nov 10, 2009, 9:57:43 AM11/10/09
to
That worked. Thanks!

Susan

"Neil Deakin" <ennd...@sympatico.ca> wrote in message

news:EOydnaXhZrjU9GTX...@mozilla.org...

0 new messages