function newImageCallback(e) {
  var eventData = e.detail;
  var element = eventData.element;
  var toolData = (0, _toolState.getToolState)(element, toolType);

  if (toolData && toolData.data) {
    toolData.data = [];
  }

  element.removeEventListener(_events2.default.MOUSE_MOVE, dragCallback);
  element.removeEventListener(_events2.default.MOUSE_DRAG, dragCallback);

  element.removeEventListener(_events2.default.MOUSE_UP, dragEndCallback);
  element.removeEventListener(_events2.default.MOUSE_CLICK, dragEndCallback);

  element.addEventListener(_events2.default.MOUSE_DOWN, mouseDownCallback);
}
/* Erases the toolData and rebinds the handlers when the image changes */
Erases the toolData and rebinds the handlers when the image changes
Erases the toolData and rebinds the handlers when the image changes
function newImageCallback(e) {
  var eventData = e.detail;
  var element = eventData.element;
  var toolData = (0, _toolState.getToolState)(element, toolType);
  if (toolData && toolData.data) {
    toolData.data = [];
  }
  element.removeEventListener(_events2.default.MOUSE_MOVE, dragCallback);
  element.removeEventListener(_events2.default.MOUSE_DRAG, dragCallback);
  element.removeEventListener(_events2.default.MOUSE_UP, dragEndCallback);
  element.removeEventListener(_events2.default.MOUSE_CLICK, dragEndCallback);
  element.addEventListener(_events2.default.MOUSE_DOWN, mouseDownCallback);
}
function newImageCallback ( e ) { var eventData = e . detail ; var element = eventData . element ; var toolData = ( 0 , _toolState . getToolState ) ( element , toolType ) ; if ( toolData && toolData . data ) { toolData . data = [ ] ; } element . removeEventListener ( _events2 . default . MOUSE_MOVE , dragCallback ) ; element . removeEventListener ( _events2 . default . MOUSE_DRAG , dragCallback ) ; element . removeEventListener ( _events2 . default . MOUSE_UP , dragEndCallback ) ; element . removeEventListener ( _events2 . default . MOUSE_CLICK , dragEndCallback ) ; element . addEventListener ( _events2 . default . MOUSE_DOWN , mouseDownCallback ) ; }
Erases the toolData and rebinds the handlers when the image changes
Erases the toolData and rebinds the handlers when the image changes