miguelgrinberg/Flask-PageDown — pull request #1 by kageurufu (2014-01-06 22:57:02+00:00)
Title: Check if document.readyState === 'complete' before trying onload listeners

Add check if the document is already ready, and if so skip the onload handlers. Fixes live loading of markdown forms

Otherwise, continue as normal.

I do a lot of server side form rendering (mainly for CSRF tokens) and loading the forms into the page (lightbox, etc) through jquery.load, and this fixes pagedown in those use cases. Does not cause problems otherwise