瀏覽代碼

Added a useful example to docs. [skip ci]

Maciej Bukowski 6 年之前
父節點
當前提交
fec0b83a30
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      packages/ckeditor5-watchdog/docs/features/watchdog.md

+ 4 - 0
packages/ckeditor5-watchdog/docs/features/watchdog.md

@@ -107,6 +107,10 @@ watchdog.state;
 // Listen to state changes.
 watchdog.on( 'change:state' ( evt, name, currentState, prevState ) => {
 	console.log( `Editor changed from ${ currentState } to ${ prevState }` );
+
+	if ( currentState === 'crashedPermanently' ) {
+		watchdog.editor.isReadOnly = true;
+	}
 } );
 
 // An array of editor crashes info.