enyojs/enyo — pull request #905 by graynorton (2014-10-28 16:35:30+00:00)
Title: ENYO-392: Allow definition of custom hold events

Garnet has requirements from MC to support "longpress" behavior,
in addition to basic "hold" behavior.

Rather than add new events globally, we will extend the existing
"configureHoldPulse" functionality so that Garnet (and others in
similar situations) can easily define a set of custom hold events
to meet their specific requirements.

We add an "events" property to the holdPulse configuration object.
This property takes an array of objects, where each object defines
a custom hold event in the form of a name / time pair. We also add
a "frequency" property that determines both the frequency of
holdpulse events as well as the frequency with which we check to
see whether it's time to fire a hold event. These new properties
together replace the old "delay" property. For backward
compatibility, we look for config objects containing "delay" and
automatically translate them to the new format.

We also expose a public enyo.gesture.drag.configureHoldPulse()
method that will allow a library or app developer to imperatively
change the default holdPulse configuration. This will allow
Garnet, for example, to universally use a custom set of hold
events, avoiding the need to override the defaults in the "down"
handler for every Control.

Also added docs for configuring holdPulse. These docs are fairly
comprehensive, but will need some editing love and some reorg to
take advantage of JSDoc structured metadata (e.g., properties
and their default values are currently described, but only in free
text).

Enyo-DCO-1.1-Signed-Off-By: Gray Norton (gray.norton@lge.com)