Changes between Version 1 and Version 2 of Ticket #15878, comment 8


Ignore:
Timestamp:
Mar 1, 2013, 5:15:56 AM (9 years ago)
Author:
bill
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #15878, comment 8

    v1 v2  
    33Your proposed patch is similar to code that's already in dijit/a11yclick.js.  The main difference of your code, compared to the code in a11yclick, is that your code is applying this behavior to every node on the page, not just nodes with a11yclick listeners on them.
    44
    5 Your code is better for performance since it just sets up a few listeners on the page rather than listeners on every node, and it possibly fixes problems trying to use event delegation with dijit/a11yclick (ex: putting a dijit/a11yclick handler on a Toolbar instead of the individual buttons).   Your code is more dangerous though; developers might not appreciate how merely loading dojo/touch causes side effects on their whole page.   A compromise would be to use your design, but only enable that behavior for nodes that have a property (ex: dojoClick) and/or attribute (ex: data-dojo-click-node) set.   That's similar to _CssStateMixin's technique.  Not sure what's best.
     5Your code is better for performance since it just sets up a few listeners on the page rather than listeners on every node, and it possibly fixes problems trying to use event delegation with dijit/a11yclick (ex: putting a dijit/a11yclick handler on a Toolbar instead of the individual buttons).   Your code is more dangerous though; developers might not appreciate how merely loading dojo/touch causes side effects on their whole page.   A compromise would be to use your design, but only enable that behavior for nodes that have a property (ex: dojoClick) and/or attribute (ex: data-dojo-click-node) or class name set.   Perhaps also check if it's set on an ancestor of the node.  That's similar to _CssStateMixin's technique.  Not sure what's best.
    66
    77Like the a11yclick code, your code has a bug where zooming the page via doubleclick causes an unexpected click event.   Except your bug is presumably worse because it affects doubleclicking anywhere on the page, not just doubleclicking nodes with dijit/a11yclick handlers.   Not an issue for pages where zoom is disabled, but it could be an issue for other pages.