Advertisement
Guest User

Untitled

a guest
Mar 21st, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. t.prototype._getRatioFromEvent = function (e) {
  2. return (e.clientX - this._dom.getBoundingClientRect().left) / this._dom.offsetWidth
  3. },
  4. t.prototype._onMouseDown = function (e) {
  5. this.ratio = this._getRatioFromEvent(e),
  6. this.props.onDragStart(e),
  7. this._addMouseEventToDocument()
  8. },
  9. t.prototype._onMouseMove = function (e) {
  10. this.ratio = this._getRatioFromEvent(e),
  11. this.isDragging || (this.isDragging = !0),
  12. this.props.onDragging(e)
  13. },
  14. t.prototype._onMouseUp = function (e) {
  15. this._removeMouseEventFromDocument(),
  16. this.ratio = this._getRatioFromEvent(e),
  17. this.isDragging = !1,
  18. this.props.onDragEnd(e)
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement