Changes between Initial Version and Version 1 of Ticket #15859, comment 6


Ignore:
Timestamp:
Aug 23, 2012, 12:44:33 PM (9 years ago)
Author:
Adrian Vasiliu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #15859, comment 6

    initial v1  
    11I'm not sure calling it in _ItemBase._onTouchEnd would be better. In this method, we don't know yet what will happen next. This method delegates the handling of the event to _onClick, which is *not* defined on _ItemBase, instead it is defined and implemented in the subclasses (!ListItem, !IconMenu). These implementations of _onClick in the subclasses are the ones which call either the user-defined onClick, or the defaultClickAction. It may not be okay to assume that any user-defined onClick would always like this selection to happen. Also, a user-defined onClick, if it wants the selection to be handled similar to the default, has anyway to call by itself _ItemBase.handleSelection, since this is only called by defaultClickAction.
    22
    3 All in one, I would rather propose to move the call from defaultClickAction to _ItemBase.handleSelection, as in the attached patch15859-variant-handleSelection.patch. This is technically equivalent to the previous variant, but probably semantically better, grouping together selection-related stuff. This way, for a user-defined click action, just calling handleSelection would restore the entire default behavior for the selection (if needed).
     3Given that defaultClickAction is already the only one to call handleSelection, it looked consistent to me it's also this method which takes care of this additional selection. But, all in one, I would rather propose to move the call from defaultClickAction to _ItemBase.handleSelection, as in the attached patch15859-variant-handleSelection.patch. This is technically equivalent to the previous variant, but probably semantically better, grouping together selection-related stuff. This way, for a user-defined click action, just calling handleSelection would restore the entire default behavior for the selection (if needed).