torchbox/wagtail — pull request #878 by davecranwell (2014-12-17 16:46:06+00:00)
Title: Fixing preview

Addresses #659, where pressing preview having already pressed it once, caused the preview window to hang.

Firefox and IE don't allow you to re-raise a child window (`window.focus()`) without the user having explicitly allowed it with some setting in their browser. So even once I'd fixed the problem, it still meant previewing was clumsy as the user was required to press preview *then* click the tab. Not exactly fluid.

The best solution for usability is just to close any existing preview windows, then re-open them every time preview is clicked. That way the browser can focus it every time.