this is nasty closure escaping. `scroll` should simply not set a timeout if an external condition dictates this, so in scroll you want something like `if (shouldScoll) { requestAnimationFrame }`, with shouldScroll getting set to false here. Setting and clearing timeouts invites potentially really weird timing issues on the thread.