plugins/tungsten-event-intent/index.js
function getIntentHandler(method, options) {
  var lastEvent = null;
  var timeout = null;

  var opts = extend({
    intentDelay: 200
  }, options);

  var triggerIntent = function() {
    method(lastEvent);
  };

  var startIntent = function(evt) {
    lastEvent = evt;
    clearTimeout(timeout);
    timeout = setTimeout(triggerIntent, opts.intentDelay);
  };

  var stopIntent = function() {
    lastEvent = null;
    clearTimeout(timeout);
  };

  return {
    startIntent: startIntent,
    stopIntent: stopIntent
  };
}
function getIntentHandler(method, options) {
  var lastEvent = null;
  var timeout = null;

  var opts = extend({
    intentDelay: 200
  }, options);

  var triggerIntent = function() {
    method(lastEvent);
  };

  var startIntent = function(evt) {
    lastEvent = evt;
    clearTimeout(timeout);
    timeout = setTimeout(triggerIntent, opts.intentDelay);
  };

  var stopIntent = function() {
    lastEvent = null;
    clearTimeout(timeout);
  };

  return {
    startIntent: startIntent,
    stopIntent: stopIntent
  };
}
function getIntentHandler ( method , options ) { var lastEvent = null ; var timeout = null ; var opts = extend ( { intentDelay : 200 } , options ) ; var triggerIntent = function ( ) { method ( lastEvent ) ; } ; var startIntent = function ( evt ) { lastEvent = evt ; clearTimeout ( timeout ) ; timeout = setTimeout ( triggerIntent , opts . intentDelay ) ; } ; var stopIntent = function ( ) { lastEvent = null ; clearTimeout ( timeout ) ; } ; return { startIntent : startIntent , stopIntent : stopIntent } ; }
Get handler for start and stop of intent events
@param  {function} method  [description]
@param  {object} options - intent options
@return {object}         - the start and stop intent events
Get handler for start and stop of intent events