Issue #1322Opened July 27, 2018by YashPrince0 reactions

Disable editing in Preview Mode.

Question

@artf How can we disable editing in the preview mode and re-enable it when preview mode off. I want to remove editor and hide toolbar in the preview mode so that user can only view the changes and can not edit it also all the editable option should be come when user stop the preview mode.

Answers (3)

jvillenaJuly 27, 20180 reactions

You can use: editor.stopCommand('sw-visibility'); editor.runCommand('sw-visibility');

YashPrinceJuly 27, 20180 reactions
Code SnippetTEXT
@jvillena  I have used this code but it is not working.

editor.on('run:preview', () => {
    editor.stopCommand('sw-visibility'); 
});

editor.on('stop:preview', () => 
   `editor.runCommand('sw-visibility');`
});
ghostJuly 27, 20180 reactions

Hi Artur ( @artf ),

I need to add save and publish button so is there any plugin available or do i need to hardcoded. Can you please help me.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.