I am using this PullToRefresh plugin:
https://github.com/BoxFactura/pulltorefresh.js#api
It works well but I have a popup on my page with div inline scroll. The problem is that when I want to scroll up (in the div) the PullToRefresh is triggered. Is it possible to "delete" or to temporarily disable the PullToRefresh when my popup is opened?
PullToRefresh.init({
mainElement: 'body',
onRefresh: function(){
refreshAll();
}
});
edit:
delete PullToRefresh;
// does not work
edit2: https://github.com/BoxFactura/pulltorefresh.js/blob/master/dist/pulltorefresh.js
PullToRefresh.init()
will return an object with a destroy()
function as callback: https://github.com/BoxFactura/pulltorefresh.js/blob/master/dist/pulltorefresh.js#L326
var refresher = PullToRefresh.init({
mainElement: 'body',
onRefresh: function(){
refreshAll();
}
});
// destroy the PullToRefresh EventListeners when you open your popup
refresher.destroy()
There's also an open Github issue about improving the way to destroy this library after initialization: https://github.com/BoxFactura/pulltorefresh.js/issues/22
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With