Don't get in the way of other click handlers
Pass window, not this, into the IIFE

In some cases (such as when bundling with Browserify) the context will
not be window, so window should be passed explicitly.