Author: ptw
Date: 2009-08-17 14:04:01 -0700 (Mon, 17 Aug 2009)
New Revision: 14496
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
Log:
Change 20090817-ptw-i by [email protected] on 2009-08-17 10:37:40 EDT
in /Users/ptw/OpenLaszlo/trunk-2
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Correct mouseover/mouseout behavior for clickdivs
Bugs Fixed: LPP-8375 onmouseout even on HTML component is firing
onmouseover, not onmouseout
Technical Reviewer: max (Message-ID: <[email protected]
>)
QA Reviewer: [email protected] (pending)
Details:
If the fix_clickable quirk is on, ignore mouseover/mouseout events
that get sent when clickdivs are disabled, because they are
redundant. Similarly, when clickdivs are re-enabled by a global
mouseout event, synthesize a mouseout to the now re-enabled view.
Tests:
Test case from bug report
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/
LzMouseKernel.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js
2009-08-17 18:28:41 UTC (rev 14495)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js
2009-08-17 21:04:01 UTC (rev 14496)
@@ -204,8 +204,10 @@
}
}
,__cachedSelection: null
+ ,__globalClickable: true
,setGlobalClickable: function (isclickable){
var el = document.getElementById('lzcanvasclickdiv');
+ this.__globalClickable = isclickable;
el.style.display = isclickable ? '' : 'none';
}
,__sendMouseMove: function(e, offsetx, offsety) {
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
2009-08-17 18:28:41 UTC (rev 14495)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
2009-08-17 21:04:01 UTC (rev 14496)
@@ -163,6 +163,7 @@
}
}
if (mousein) {
+ var wasClickable =
LzMouseKernel.__globalClickable;
if (quirks.fix_ie_clickable) {
LzMouseKernel.setGlobalClickable(true);
}
@@ -177,6 +178,13 @@
LzMouseKernel.setMouseControl(true);
LzMouseKernel.__resetMouse();
this.mouseisover = true;
+ if (quirks.fix_clickable && (! wasClickable)
&& LzMouseKernel.__globalClickable) {
+ // NOTE: [2008-08-17 ptw] (LPP-8375) Forward
+ // the event to the view, if it would have
+ // gotten it without the quirk clickability
+ // diddling
+ LzMouseKernel.__sendEvent('onmouseout',
e.target.owner);
+ }
} else {
if (quirks.focus_on_mouseover) {
if (LzInputTextSprite.prototype.__lastshown
== null) {
@@ -1370,6 +1378,21 @@
}
}
+ if (this.quirks.fix_clickable && (!
LzMouseKernel.__globalClickable)) {
+ // NOTE: [2008-08-17 ptw] (LPP-8375) When the mouse goes
+ // over an html clickdiv, globalClickable gets disabled,
+ // which generates a mouseout -- we want to ignore that.
+ // Simlutaneously, the mouse enters the associated
iframe,
+ // which will forward a mouseover to us, but we already
+ // got one, so, we want to ignore that too. The global
+ // mouseout handler will synthesize a mouseout event for
+ // the html sprite when the mouse leaves the iframe and
+ // re-enables the clickdiv.
+ if ((eventname == 'onmouseout') || (eventname ==
'onmouseover')) {
+ return;
+ }
+ }
+
LzMouseKernel.__sendEvent(eventname, this.owner);
}
}
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins