Browse Source

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

ycw 1 year ago
parent
commit
4ec57f5014
1 changed files with 5 additions and 2 deletions
  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();
 
 	// ---