Explorar el Código

initialize Edit>Undo/Redno once on editor start (#28332)

ycw hace 1 año
padre
commit
4ec57f5014
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      editor/js/Menubar.Edit.js

+ 5 - 2
editor/js/Menubar.Edit.js

@@ -47,7 +47,7 @@ function MenubarEdit( editor ) {
 	} );
 	options.add( redo );
 
-	editor.signals.historyChanged.add( function () {
+	function onHistoryChanged() {
 
 		const history = editor.history;
 
@@ -66,7 +66,10 @@ function MenubarEdit( editor ) {
 
 		}
 
-	} );
+	}
+
+	editor.signals.historyChanged.add( onHistoryChanged );
+	onHistoryChanged();
 
 	// ---