watusi / jquery-mobile-iscrollview

JQuery Mobile widget plug-in for easy use of the iScroll javascript scroller.
408 stars 183 forks source link

Call to widget destroy function throws error: topSpacerClass is undefined #116

Closed ronroberts closed 10 years ago

ronroberts commented 11 years ago

On Android, I have a Cordova-based application that is hooking all textarea and text input controls; click event. It calls a routine that calls the destroy method of two iscrollview controls resulting in this error (in the first such call). In terms of options, all were at their defaults except:

    $.mobile.iscrollview.prototype.options.vscroll = true;
    $.mobile.iscrollview.prototype.options.hscroll = false;
    $.mobile.iscrollview.prototype.options.preventPageScroll = false;
    $.mobile.iscrollview.prototype.options.resizeWrapper = false;           
ronroberts commented 11 years ago

Solution to this is to change _undoAddSpacers to the following:

this.$wrapper.find(this.options.topSpacerClass).remove();
this.$wrapper.find(this.options.bottomSpacerClass).remove();
jtara commented 10 years ago

Fixed in 8d187b1