Bugs item #233785, was opened at 2001-02-23 09:36
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105757&aid=233785&group_id=5757

Category: DynAPI 2 Browser-Specific
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Scott Severtson (scottsevertson)
Assigned to: Nobody/Anonymous (nobody)
Summary: NS 4 onclick & DragEvent

Initial Comment:
Under Netscape 4.x:
Child layers of a draggable layer do not recieve onclick events. 

Cause:
Cancelling an onmousedown event in NS 4.x prevents the onclick event from firing. 
DragEvent.js (from the current release) calls e.cancelBrowserEvent() in the 
DragEvent.lyrListener.onmousedown function (line 26).

Fix:
Commenting out e.cancelBrowserEvent() in DragEvent.js resolves the symptoms, although 
I am not sure of the possible repercussions of this.


Test case:
  Click the "X" layer. Console does not show onclick event, but does show onmousedown 
and onmouseup events.

  Appply the above Fix and try again. the onclick event fires.



<HTML>
<HEAD>
<TITLE>DynAPI Testing</TITLE>
<SCRIPT LANGUAGE="JavaScript" SRC="../src/dynapi.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript"><!--

        DynAPI.setLibraryPath("../src/lib/");
        DynAPI.include("dynapi.api.*");
        DynAPI.include("dynapi.util.console.js");

        var lyrChild, lyrParent;

        DynAPI.onLoad = function() {
                var evtChild;

                DynAPI.console.open();

                lyrParent = new DynLayer("Parent", 100, 200, 300, 200, "#CCCCCC");
                lyrChild = new DynLayer("Child", 270, 10, 20, 20, "#FFFFFF");

                lyrParent.setHTML("<EM>Parent</EM>");
                lyrChild.setHTML("<STRONG>X</STRONG>");

                DragEvent.setDragBoundary(lyrParent);
                DragEvent.enableDragEvents(lyrParent);

                evtChild = new EventListener(lyrChild);
                evtChild.onclick = function(e) {
                        DynAPI.console.write("Child: onclick");
                        lyrParent.deleteFromParent();
                }
                evtChild.onmousedown = function(e) {
                        DynAPI.console.write("Child: onmousedown");
                }
                evtChild.onmouseup = function(e) {
                        DynAPI.console.write("Child: onmouseup");
                }
                lyrChild.addEventListener(evtChild);

                lyrParent.addChild(lyrChild);
                DynAPI.document.addChild(lyrParent)
        }
//--></SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
</BODY>
</HTML>


----------------------------------------------------------------------

Comment By: Ernest MacDougal Campbell III (emc3)
Date: 2001-06-27 11:53

Message:
Logged In: YES 
user_id=29866

I'm glad I decided to look through the bug database. This 
problem has been driving me batty until now. Adding the 
conditional !is.ns4 for the e.cancelBrowserEvent() did the 
trick for me.


----------------------------------------------------------------------

Comment By: Cameron Hart (camhart)
Date: 2001-03-06 08:18

Message:
Logged In: YES 
user_id=131268

This fixes the problem for me, although I'd suggest rather
than commenting the line out, just change it to:

if (!is.ns4) e.cancelBrowserEvent();

if think what the line does is stops text selection on drag
in some browsers. maybe ;-)

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105757&aid=233785&group_id=5757

_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-dev

Reply via email to