Disable editing in Preview Mode.
@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.
You can use: editor.stopCommand('sw-visibility'); editor.runCommand('sw-visibility');
@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');
});
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.
editor.on('run:preview', () => {
// Execute a callback on all inner components starting from the root
editor.DomComponents.getWrapper().onAll(comp =>
comp.is('text') && comp.set({ editable: false })
);
});
// Same for the `stop:preview` but set editable to true
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.