Closed qiangzi7723 closed 6 years ago
Thank you for this question! Yes, you are correct. I realize this all a bit confusing. The main reason is that Draggabilly is built upon two other libraries
unipointer -> unidragger -> draggabilly
unipointer provides the base methods for handling the mouse/touch events. _pointerMove
is a private method that should not be overwritten. pointerMove
is the public method which can be overwritten. Both unidragger and draggabilly overwrite pointerMove
. I realize this seems like unecessary code waste, but it allows for a modular pattern. unidragger is reused within Flickity. unipointer is reused in Huebee and tap-listener. Try looking at those repos to see how they overwrite and re-use methods.
I am looking at the source code of draggabilly. And I found some functions which bind on prototype are repeated. Such as
pointerMove
function, I can find there are threepointerMove
functions in the source code but only the last one which bind on Draggabilly prototype can be used. So I am confused why so much repeated function in the source code? Because of the update and forget to delete or other? Thank you for your answer.