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

Do setDragImage or addElement work?

149 views
Skip to first unread message

alta88[nntp]

unread,
Sep 8, 2011, 1:18:43 PM9/8/11
to

i've tried to set a drag image according to the doc
https://developer.mozilla.org/En/DragDrop/Drag_Operations#dragfeedback

as well as usage in mozilla-central codebase (all of 2), for which
neither the favicon drag image when dragging 1) the urlbar identity box,
nor 2) a tab, actually work.

i haven't found any working example in html5, using Fx 9a, either. can
anyone verify if this is indeed supported, as the docs seems to
indicate, and if there is an example anywhere?

Neil Deakin

unread,
Sep 8, 2011, 2:43:56 PM9/8/11
to
setDragImage is implemented. The documentation example you gave should
work ok.


alta88[nntp]

unread,
Sep 8, 2011, 7:22:41 PM9/8/11
to
i have this code, from the doc, to set an image under the cursor when
dnd on a Tb thread pane message. i've tried with a visible xul <image>
element as well. nothing shows an image.

do you have an example? xul or html, i haven't found either anywhere.
dnd on the Fx urlbar favicon doesn't show a dragged image for me, should it?

-----------
var _ThreadPaneOnDragStart = ThreadPaneOnDragStart;
ThreadPaneOnDragStart = function TM_ThreadPaneOnDragStart(aEvent) {

if (v.editingMode) {
// In edit mode, support drag and drop rethreading of messages.

...

var image =
document.createElementNS("http://www.w3.org/1999/xhtml","html:canvas");
image.width = image.height = 50;
var ctx = image.getContext("2d");
ctx.lineWidth = 4;
ctx.moveTo(0, 0);
ctx.lineTo(50, 50);
ctx.moveTo(0, 50);
ctx.lineTo(50, 0);
ctx.stroke();

var dt = aEvent.dataTransfer;
dt.setData('text/plain', 'Data to Drag');
// aEvent.dataTransfer.effectAllowed = "move";
// aEvent.dataTransfer.dropEffect = "move";
dt.setDragImage(image, 0, 0);
_u.log.debug("ThreadPaneOnDragStart: image - "+ image.id);
return;
}

_ThreadPaneOnDragStart(aEvent);
}
0 new messages