_mouseDestroy not implemented #124

Closed
chumanfu opened this Issue Sep 30, 2013 · 2 comments

Comments

Projects
None yet
2 participants

Hi

I have a problem with jquery ui selectable. If I make UL which is scrollable selectable and then called selectable('destroy') the item no longer scrolls.

If I add this to Touch Punch it works:

var mouseProto = $.ui.mouse.prototype,
_mouseInit = mouseProto._mouseInit,
_mouseDestroy = mouseProto._mouseDestroy,
touchHandled;

mouseProto._mouseDestroy = function () {

var self = this;

// Un-Delegate the touch handlers to the widget's element
self.element
  .unbind('touchstart', $.proxy(self, '_touchStart'))
  .unbind('touchmove', $.proxy(self, '_touchMove'))
  .unbind('touchend', $.proxy(self, '_touchEnd'));

// Call the original $.ui.mouse destroy method
_mouseDestroy.call(self);

};

Is there any reason why _mouseDestroy has never been implemented?
Is my code above okay to use?

Cheers

Chris

furf self-assigned this Feb 5, 2014

Owner

furf commented Feb 5, 2014

The code looks good. I am doing some housecleaning this week, so I'll see about possible implementation.

@furf furf pushed a commit that referenced this issue Feb 10, 2014

HUGE | furf Handle touch cleanup when widget is destroyed 8f7559b
Owner

furf commented Feb 10, 2014

Fixed in 0.2.3. Thanks!

furf closed this Feb 10, 2014

@heiskr heiskr pushed a commit to optimalworkshop/jquery-ui-touch-punch that referenced this issue Jan 23, 2015

HUGE | furf Handle touch cleanup when widget is destroyed 7db67fc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment