Tucker, I refactored one method to let me find the context menu, but I didn't make the optimization of caching it, I figure this is a user-event triggered operation, so the speed should be ok, and didn't want to make it any more complex than it already is.
Change 20090822-hqm-k by [email protected] on 2009-08-22 13:48:37 EDT in /Users/hqm/openlaszlo/trunk-clean for http://svn.openlaszlo.org/openlaszlo/trunk Summary: make dhtml contextmenu display browser builtin menu when it's supposed to New Features: Bugs Fixed: LPP-8128 Technical Reviewer: ptw QA Reviewer: max Doc Reviewer: (pending) Documentation: Release Notes: Details: + In LzMouseKernel.js, factor out the code to find the appropriate context menu from the code to display it, so that, when displaying a contextmenu, we can check to see if whether there is user-defined contextmenu (and if not, display the builtin browser menu) + In r14526, forgot to include the modified LzSprite file, which defines the new has_dom2_mouseevents quirk Tests: When you right click, the following test case should display the browser builtin menu when mouse is over the canvas, and the user-defined menu when in the red square. <canvas debug="true" height="100%"> <handler name="oninit"> canvas.setDefaultContextMenu(null); </handler> <view width="200" height="200" bgcolor="0xff0000"> <contextmenu name="cm" onmenuopen="Debug.write('opened menu')" > <contextmenuitem caption="hello world"/> </contextmenu> </view> </canvas> Files: M test/switch.lzx 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/20090822-hqm-k.tar _______________________________________________ Laszlo-reviews mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-reviews
