Adding buttons to toggle preview and editor