Reverts #5551e12, commit has breaking changes for non-WebKit browsers.

5551e12853bb29de7ba685bea7dcdc8628bc186b introduced a bug where page scroll was not taken into account on non-WebKit browsers. This had the effect of launching a modal at the top of a page, even if the user opened it while scrolled to the bottom.

This commit simply reverts the to the last working version.