[Laszlo-checkins] r13882 - openlaszlo/trunk/lps/includes/source

max@openlaszlo.org max at openlaszlo.org
Wed May 13 14:10:35 PDT 2009


Author: max
Date: 2009-05-13 14:10:35 -0700 (Wed, 13 May 2009)
New Revision: 13882

Modified:
   openlaszlo/trunk/lps/includes/source/iframemanager.js
Log:
Change 20090513-maxcarlson-X by maxcarlson at Bank on 2009-05-13 13:25:58 PDT
    in /Users/maxcarlson/openlaszlo/trunk-clean
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Correct iframe mouseover/out event sending

Bugs Fixed: LPP-8177 - Don't get mouseover on LZX view over an iframe when I click on the iframe in Firefox

Technical Reviewer: hminsky
QA Reviewer: lorien

Details: Listen for onclick events - those weren't sent before.  Clean up LzMouseKernel.__lastMouseDown flag since window.document.onmouseup events aren't sent for iframes.

Tests: See LPP-8177



Modified: openlaszlo/trunk/lps/includes/source/iframemanager.js
===================================================================
--- openlaszlo/trunk/lps/includes/source/iframemanager.js	2009-05-13 20:58:46 UTC (rev 13881)
+++ openlaszlo/trunk/lps/includes/source/iframemanager.js	2009-05-13 21:10:35 UTC (rev 13882)
@@ -238,6 +238,7 @@
         try {
             lz.embed.attachEventHandler(iframe.document, 'mousedown', lz.embed.iframemanager, '__mouseEvent', id);
             lz.embed.attachEventHandler(iframe.document, 'mouseup', lz.embed.iframemanager, '__mouseEvent', id);
+            lz.embed.attachEventHandler(iframe.document, 'click', lz.embed.iframemanager, '__mouseEvent', id);
             //lz.embed.attachEventHandler(iframe.document, 'mousemove', lz.embed.iframemanager, '__mouseEvent', id);
             iframe.document.oncontextmenu = function(e) {
                 return lz.embed.iframemanager.__mouseEvent(e, id);
@@ -301,6 +302,7 @@
             try {
                 lz.embed.removeEventHandler(iframe.document, 'mousedown', lz.embed.iframemanager, '__mouseEvent');
                 lz.embed.removeEventHandler(iframe.document, 'mouseup', lz.embed.iframemanager, '__mouseEvent');
+                lz.embed.removeEventHandler(iframe.document, 'click', lz.embed.iframemanager, '__mouseEvent');
                 //lz.embed.removeEventHandler(iframe.document, 'mousemove', lz.embed.iframemanager, '__mouseEvent');
                 iframe.document.oncontextmenu = null;
                 if (lz.embed.browser.isIE) {
@@ -373,9 +375,15 @@
                 var pos = lz.embed.getAbsolutePosition(iframe); 
                 LzMouseKernel.__sendMouseMove(e, pos.x, pos.y)
                 return LzMouseKernel.__showContextMenu(e);
-            } else {
-                iframe.owner.sprite.__mouseEvent(e);
             }
+            iframe.owner.sprite.__mouseEvent(e);
+
+            // clear __lastMouseDown to prevent mouseover/out events being sent as dragin/out events - see LzSprite.js and LzMouseKernel.js - there will be no global mouseup sent from window.document to clear this...
+            if (eventname == 'onmouseup') {
+                if (LzMouseKernel.__lastMouseDown = iframe.owner.sprite) {
+                    LzMouseKernel.__lastMouseDown = null;
+                }
+            }
         } else {
             // deal with IE event names
             if (eventname == 'onmouseleave') {



More information about the Laszlo-checkins mailing list