{"size": 1169, "ext": "js", "max_stars_repo_path": "src/imageTools/touchDragTool.js", "max_stars_repo_name": "enlitic/cornerstoneTools", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/imageTools/touchDragTool.js", "max_issues_repo_name": "enlitic/cornerstoneTools", "max_issues_repo_issues_event_min_datetime": "2016-08-03T00:50:50.000Z", "max_issues_repo_issues_event_max_datetime": "2016-08-03T00:50:50.000Z", "max_forks_repo_path": "src/imageTools/touchDragTool.js", "max_forks_repo_name": "enlitic/cornerstoneTools", "max_forks_repo_forks_event_min_datetime": "2019-05-03T06:08:00.000Z", "max_forks_repo_forks_event_max_datetime": "2019-05-03T06:08:00.000Z"}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": 1, "avg_line_length": 25.9777777778, "max_line_length": 68, "alphanum_fraction": 0.624465355}
export default function (touchDragCallback, options) {
  let events = 'CornerstoneToolsTouchDrag';

  if (options && options.fireOnTouchStart === true) {
    events += ' CornerstoneToolsTouchStart';
  }

  const toolInterface = {
    activate (element) {
      $(element).off(events, touchDragCallback);

      if (options && options.eventData) {
        $(element).on(events, options.eventData, touchDragCallback);
      } else {
        $(element).on(events, touchDragCallback);
      }

      if (options && options.activateCallback) {
        options.activateCallback(element);
      }
    },
    disable (element) {
      $(element).off(events, touchDragCallback);
      if (options && options.disableCallback) {
        options.disableCallback(element);
      }
    },
    enable (element) {
      $(element).off(events, touchDragCallback);
      if (options && options.enableCallback) {
        options.enableCallback(element);
      }
    },
    deactivate (element) {
      $(element).off(events, touchDragCallback);
      if (options && options.deactivateCallback) {
        options.deactivateCallback(element);
      }
    }
  };


  return toolInterface;
}
