Live preview fix

This PR is a quick fix for previewing a document using live preview.

- Uses the stashed content and metadata for the preview, so that you can preview before saving.
- Keeps the file in edit mode when using live preview, which opens a new window right now.