Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

options onStart, onEnd, onMove don't work #84

Open
czzplnm opened this issue Nov 26, 2020 · 0 comments
Open

options onStart, onEnd, onMove don't work #84

czzplnm opened this issue Nov 26, 2020 · 0 comments

Comments

@czzplnm
Copy link

czzplnm commented Nov 26, 2020

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant