apeatling / web-pull-to-refresh

A native-like JavaScript pull to refresh implementation for the web.
https://apeatling.com/articles/javascript-pull-to-refresh-web/
MIT License
545 stars 93 forks source link

ptrEl and contentEl options expecting elements, not IDs #11

Open raglan-road opened 9 years ago

raglan-road commented 9 years ago

According to the documentation, the ptrEl and contentEl options are the IDs of those respective elements. However, the code does not use them as IDs: it never passes them into, say, document.getElementId to fetch the actual elements. This has the side effect of causing Hammer to throw an exception if these parameters are used.

There are two options here: pass in the elements directly (which does not require a code change but might be kind of wonky) or update the code to make sure we're getting elements back. I'll attach a pull request for the latter.