[Laszlo-dev] For Review: Change 20090516-bargull-GQn Summary: once more contextmenus for dhtml
André Bargull
andre.bargull at udo.edu
Sat May 16 08:56:25 PDT 2009
Change 20090516-bargull-GQn by bargull at dell--p4--2-53 on 2009-05-16 17:15:31
in /home/Admin/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: once more contextmenus for dhtml
New Features:
Bugs Fixed: LPP-8189 (Right click fires an erroneous mousedown and
mouseup in DHTML.), LPP-8142 (On a mac right click using two finger tap
on the trackpad doesn't register as right click, it registers as left
click)
Technical Reviewer: max
QA Reviewer: henry
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
LzContextMenuKernel:
- remove "__sentshowevent", it didn't work properly (consider this:
right to open contextmenu, then right click again => __sentshowevent is
still set => no onmenuopen event)
- remove listeners to onmousedown, onmouseup, onclick from
anchor-elements, this didn't work in Firefox. Instead add handlers to
lzcontextmenu-div
- only show contextmenu if "showbuiltins" isn't set
- remove ignore-arg from __hide(), no longer needed
LzSprite:
- add quirk for Safari, because middle mouse button click sends
onclick-event
- canceling event-bubbling for all mouse-events => this was already done
for all browsers (except Firefox) and all events (except onmouseup). Why
wasn't Firefox affected? => All other browsers set "event.keyCode" to
'0' for mouse-events, only Firefox sets "keyCode" to 'undefined'. Now
take a look at "LzKeyboardKernel.__keyboardEvent()", every event was
canceled in that function if "keyCode" was '>= 0'!
- only handle onmousedown/onmouseup for left button
- if right button is clicked, delegate onmouseup event to LzMouseKernel
to show contextmenu
LzKeyboardKernel:
- move handling for control keys (ctrl, shift, alt) into separate
function. It should be obvious why having a single function for both,
mouse-events and keyboard-events, is a bad idea (see keyCode issue from
above).
LzMouseKernel:
- hide contextmenu on "onmousedown", not "onclick". Because it's
compliant with swf and if you drag the mouse, you don't get an
"onclick"-event, so drag and click won't hide the contextmenu
- again, only onmousedown/onmouseup for left button
- and show contextmenu if right button is clicked
Tests:
see tests from bugreports (IE, Firefox, Safari, Opera)
Files:
M WEB-INF/lps/lfc/kernel/dhtml/LzKeyboardKernel.js
M WEB-INF/lps/lfc/kernel/dhtml/LzContextMenuKernel.lzs
M WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
M WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js
Changeset:
http://svn.openlaszlo.org/openlaszlo/patches/20090516-bargull-GQn.tar
More information about the Laszlo-dev
mailing list