Looks reasonable to me. I wonder if you should cache the hasFeature check as a quirk on LzSprite, so you don't have to make that function call on every right click?
On 2009-08-21, at 17:17EDT, Henry Minsky wrote: > Note, this always suppresses the system built-in context menu, but as > far as I can tell, the code was > already always doing that, the showContextMenu function always > defaults to the canvas (root sprite) context menu. > > > If the rich text editor needs to get the default menu, maybe that is > implicitly done because it's in its own iframe? > > > Change 20090821-hqm-K by [email protected] on 2009-08-21 17:13:37 EDT > in /Users/hqm/openlaszlo/trunk-clean > for http://svn.openlaszlo.org/openlaszlo/trunk > > Summary: allow oncontextmenu to be sent even when context menu is > already open > > New Features: > > Bugs Fixed: LPP-8218 > > Technical Reviewer: max > QA Reviewer: ptw > Doc Reviewer: (pending) > > Documentation: > > Release Notes: > > Details: > > + the original bug which was being worked around seems to have been > fixed (the one where the Mac browser sent a left-click instead of > right click when using the two-finger tap-click to simulate a right > mouse button). > > LzMouseKernel: > > + removes the workaround in __mouseEvent where mousedown-right was > treated as 'oncontextmenu' event. > > + check if DOM level 2 mouse events are supported, and if so use > mousedown-right to trigger context menu display. Otherwise use the > 'oncontextmenu' event. > > LzContextMenuKernel: removes the "__sentshowevent" flag from the code > for displaying the menu > > Tests: > > test case from bug report > > + onmenuopen event should fire just once when menu is opened. > + If the context menu is already open, clicking right again SHOULD > sent another onmenuopen event > > <canvas debug="true" height="100%"> > <view width="200" height="200" bgcolor="0xff0000"> > <contextmenu name="cm" onmenuopen="Debug.write('opened menu')" > > <contextmenuitem caption="hello world"/> > </contextmenu> > </view> > </canvas> > > Files: > M WEB-INF/lps/lfc/kernel/dhtml/LzBrowserUtils.js > M WEB-INF/lps/lfc/kernel/dhtml/LzContextMenuKernel.lzs > M WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js > > > Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20090821-hqm-K.tar > _______________________________________________ > Laszlo-reviews mailing list > [email protected] > http://www.openlaszlo.org/mailman/listinfo/laszlo-reviews _______________________________________________ Laszlo-reviews mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-reviews
