Skip to content

Commit e9ae817

Browse files
committed
feat: Expose undo/redo actions to the Android host app
Enable navigating editor history from the host app.
1 parent 8509973 commit e9ae817

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

android/Gutenberg/src/main/java/org/wordpress/gutenberg/GutenbergView.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,18 @@ class GutenbergView : WebView {
310310
}
311311
}
312312

313+
fun undo() {
314+
handler.post {
315+
this.evaluateJavascript("editor.undo();", null)
316+
}
317+
}
318+
319+
fun redo() {
320+
handler.post {
321+
this.evaluateJavascript("editor.redo();", null)
322+
}
323+
}
324+
313325
@JavascriptInterface
314326
fun onEditorLoaded() {
315327
Log.i("GutenbergView", "EditorLoaded received in native code")

0 commit comments

Comments
 (0)