zingtouch icon indicating copy to clipboard operation
zingtouch copied to clipboard

options onStart, onEnd, onMove don't work

Open czzplnm opened this issue 5 years ago • 0 comments

I am following the examples here: https://zingchart.github.io/zingtouch/

And more specifically the pan example here: https://codepen.io/zingchart/pen/RRpyJY

But they don't even follow the docs, for example it is assigning the start function and then calling it within a custom function.


var startPan = customPan.start;

customPan.start = function(inputs) {
  var canvas = document.getElementById('main-canvas');
  var canvasRect = canvas.getBoundingClientRect();

  var x = inputs[0].current.x - canvasRect.left;
  var y = inputs[0].current.y - canvasRect.top;
  currentIndex = getIndex(x, y);
  if (currentIndex !== null) {
    bubbles[currentIndex].stopped = true;
  }

  return startPan.call(this, inputs);
}

Why is it doing it this way? Can you fix onStart, onEnd, onMove from the options object like the docs say?

czzplnm avatar Nov 26 '20 01:11 czzplnm