persist the window/drawer/media state when saving a text document