Update of /cvsroot/dynapi/dynapi/src/lib/dynapi/api
In directory usw-pr-cvs1:/tmp/cvs-serv25601

Modified Files:
        events.js 
Log Message:
I fixed IEs event problems ( I hope )
The problem was in the eventmethod. Looking for realsrc accessing the e.srclement is 
wrong, because depending
on the contents of the layer that object would be a TD, FONT or any tag, which does not
have a lyrobj reference set.

The event now searches for the parent layer with a lyrobj reference instead of
merely looking at the current element.

Index: events.js
===================================================================
RCS file: /cvsroot/dynapi/dynapi/src/lib/dynapi/api/events.js,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** events.js   2001/01/09 05:37:01     1.9
--- events.js   2001/01/11 10:20:55     1.10
***************
*** 89,112 ****
  DynLayer.prototype.EventMethod = function(e) {
        var dyndoc=this.lyrobj.dyndoc;
        if (is.ie) {
                var e=dyndoc.elm.event;
                e.cancelBubble=true;
                if (e.type=="click" && DynAPI.wasDragging) {
!                       e.cancelBubble=true;
                        DynAPI.wasDragging=false;
                        return true;
                }
!               if (e.type!="mouseout" && e.type!="mouseover") e.cancelBubble=true;
                if (e.type=="mouseout" && this.contains(e.toElement)) return true;
                if (e.type=="mouseover" && this.contains(e.fromElement)) return true;
        }
!       var realsrc=is.ie ? e.srcElement:e.target;
!       var which=(is.ie||is.ns5)?e.button:e.which;
!       var src=realsrc.lyrobj||this.lyrobj;
!     if (!src) return true;
!       var evt=dyndoc._e;
!       evt.setEvent(src,e);
!       var type=evt.type;
!       src.invokeEvent(type,evt);
        if (e.type=="mouseover" || e.type=="mouseout") return false;
        evt.bubbleEvent();
--- 89,118 ----
  DynLayer.prototype.EventMethod = function(e) {
        var dyndoc=this.lyrobj.dyndoc;
+ 
        if (is.ie) {
                var e=dyndoc.elm.event;
                e.cancelBubble=true;
                if (e.type=="click" && DynAPI.wasDragging) {
!                       //e.cancelBubble=true;          redundant
                        DynAPI.wasDragging=false;
                        return true;
                }
!               //if (e.type!="mouseout" && e.type!="mouseover") e.cancelBubble=true;  
         redundant
                if (e.type=="mouseout" && this.contains(e.toElement)) return true;
                if (e.type=="mouseover" && this.contains(e.fromElement)) return true;
        }
! 
!       var realsrc=is.ie?e.srcElement:e.target
!       var which=(is.ie||is.ns5)?e.button:e.which
! 
!       // In IE, search for parent div, if any, because it will have a reference to 
the DynLayer
!       for(;is.ie && !realsrc.lyrobj && realsrc.parentElement && 
realsrc.parentElement!=realsrc;realsrc=realsrc.parentElement);
! 
!       var src = realsrc.lyrobj||dyndoc
!       if (!src) return true
!       var evt=dyndoc._e
!       evt.setEvent(src,e)
!       var type=evt.type
!       src.invokeEvent(type,evt)
        if (e.type=="mouseover" || e.type=="mouseout") return false;
        evt.bubbleEvent();
***************
*** 133,137 ****
                orig=e.orig;
                e.cancelBubble=false;
!     }
        if (is.ns4 && is.platform=="other") {
                if (type=="mousedown") {
--- 139,143 ----
                orig=e.orig;
                e.cancelBubble=false;
!       }
        if (is.ns4 && is.platform=="other") {
                if (type=="mousedown") {


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

Reply via email to