Ok, I've seen the code in ie. I moved that as well to the dragevent. In fact when a drag start, there's some code that disable the selectstart:
if (dynapi.ua.dom) {
lyr.elm.ondragstart = dynapi.functions.False
lyr.elm.onselectstart = dynapi.functions.False
}
I had to move that test to the mousemove after we're sure a drag session starts, otherwise the text wouldn't be selectable when an click happens if that code stayed where it was after my modifications.

So to fix the ie issue, in the mouseup, we just have to enable it again:

if (dynapi.ua.ie) { //Was there
lyr.doc.body.onselectstart = null; //Was there
lyr.elm.ondragstart = dynapi.functions.Allow //Added
lyr.elm.onselectstart = dynapi.functions.Allow; //Added
}

I have 2 questions before I send you the changes so that you can test it.
On the drag start, the test is made for dynapi.ua.dom, and in the mouse up for dynapi.ua.ie. I don't think that's right, moreover because I think ondragstart and onselectstart aren't standard and doesn't exists outside of IE. Please correct me if I'm wrong, but otherwise, the first test should use dynapi.ua.ie too.

The other question is why do we do "lyr.doc.body.onselectstart = null;" ? It wasn't modified before in the dragevent code, so why touching it here ?

As soon as I get answers from you, I'll send the dragevent, the mouse_dom and mouse_ie modified so you can test validate it before I commit to cvs.

Thanks,

Benoit

On Wednesday, March 12, 2003, at 07:45 PM, Raymond Irving wrote:

--- Benoit Marchant <[EMAIL PROTECTED]> wrote:
Well,

If I comment the code I've added in dragstart, it
works everywhere but
in Safari. If I comment the code in
MouseEvent._eventHandler() , and
use only the one I've added in dragstart , it works
fine everywhere.
So I don't know why. However, it seems more logical
to have thes check
which are drag specific in dragevent rather that in
mouse_...

So I would say, let's comment out the code in
MouseEvent._eventHandler() in favor of the one in
dragevent. Run some
tests to make sure.

Ok, sounds good to me

The code you mention in mouse_ie.js is the block
about the drag event
or is it another one ?

Line 86

if(tt=='textarea'||tt=='text' &&
target.onselectstart==null) target.onselectstart =
dynapi.functions.Allow;

--
Raymon Irving


Benoit

On Wednesday, March 12, 2003, at 06:51 PM, Raymond
Irving wrote:

One other thing...

Have you looked at the mouseevent codes
(mouse_xxxjs)?
The MouseEvent._eventHandler() contains some codes
that will prevent form elements from being
dragged.
Inside the mouse_ie.js file you'll also see a new
piece of code that enables selection of text
inside
the textarea if the layer is drag-able.

So in that case we can either more the code from
MouseEvent._eventHandler() to dragevent.js or
remove
the code from drag events. What do you think?

--
Raymond Irving

--- Benoit Marchant <[EMAIL PROTECTED]> wrote:
Well, I think it did before I modified the code.
In
dynapi2, there the
following:

DynMouseEvent.EventMethod=function(e) {
var dynobject=this.lyrobj;
if(is.def) {
if (is.ie) var e=dynobject.frame.event
e.cancelBubble=true;

if (DynAPI.wasDragging && e.type=="click") {
DynAPI.wasDragging=false;
return false;
}
}
....

to avoid sending onclick after a dragend. We can
re
do the same, the
wasDragging is still set in dragevent.js
I can't think of a case where it would be bad to
receive both. But if
we need to do it, we know what to do !

So I'll go on and commit the changes.

Benoit

On Wednesday, March 12, 2003, at 01:36 PM,
Raymond
Irving wrote:

Yep! It works fine on my machine with the
exeception
of one thing...

The onclick event is been triggered at the end
of
a
drag. Is that by design?

--
Raymond Irving


--- Benoit Marchant <[EMAIL PROTECTED]> wrote:
Thanks Raymond, that should fix the ondragend
issue, but listeners
would still receive an ondragstart and maybe an
ondragmove.
The only way I see to do it "right" would be to
bring back the logic
from dynapi2.
I've brought back t he fix to be able to use
form
elements in draggable
layers.

Here it is. Please test in on your machines



ATTACHMENT part 2 application/octet-stream
x-unix-mode=0755; name=dragevent.js

---------------------------------
DynAPI Examples - Drag
Eventdynapi.library.setPath('../src/




');dynapi.library.include('dynapi.api');dynapi.library.include('dynapi.



library');dynapi.library.include('dynapi.debug');dynapi.library.include
('DragEvent');var
p = dynapi.document.addChild(new
DynLayer(null,50,90,200,200,'silver'))var
a=p.addChild(new




DynLayer(null,10,10,20,20,'red'))DragEvent.enableDragEvents(a);DragEven
t.setDragBoundary(a,
{left:5, right:5, top:5, bottom:5});var p2 =
dynapi.document.addChild(new


DynLayer(null,300,90,200,200,'silver'))p2.setHTML('
[input] ');DragEvent.enableDragEvents(p2);var
dragevents = {};dragevents.onclick = function(e)
{
var
o = e.getSource();
document.frm.click.value =
'onclick'; document.frm.dragstart.value = '';
document.frm.drag.value =
'';}dragevents.ondragstart =
function(e) { var o = e.getSource();
document.frm.dragstart.value = e.type;
document.frm.click.value =
'';}dragevents.ondragmove =
dragevents.ondragend = function(e) { var o =
e.getSource(); if(e.type == 'ondragend')
document.frm.dragstart.value = '';
document.frm.drag.value =




e.type;}a.addEventListener(dragevents);dynapi.onLoad(function()
{ str = '// Try these tests:\n\n'+
'p.setSize(150,350);\n'+
'//p.setSize(200,200);\n';
dynapi.debug.setEvaluate(str);});Click: [input]
Drag Start: [input]
Drag: [input]
dynapi.document.insertAllChildren();>
if it's working fine, I'll commit to cvs.

Benoit

On Tuesday, March 11, 2003, at 08:39 PM,
Raymond
Irving wrote:

Notes my comments below:

--- Benoit Marchant <[EMAIL PROTECTED]> wrote:
Hi

I mentioned it before, but I'm pretty sure we
need
to address this. If
you click on a layer that's dragable, you
will
both
get ondragend and
onclick called. If you have an event handler
on
both
events doing
different things, you're screwed !
I believe, tell me if that's wrong, that the
ondragend event should no
be sent if just a click happens. To fix that,

=== message truncated ===


__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://www.mail-archive.com/[EMAIL PROTECTED]/

Reply via email to