code: function cancel(restore) {
      var previousContext;
  
      if (!context) {
        return;
      }
  
      var wasActive = context.active;
  
      if (wasActive) {
        fire('cancel');
      }
  
      previousContext = cleanup(restore);
  
      if (wasActive) {
        // last event to be fired when all drag operations are done
        // at this point in time no drag operation is in progress anymore
        fire('canceled', previousContext);
      }
    }
docs: life-cycle methods