I want to host an event when the theme changes. Do not use setTheme()
.
var editor = ace.edit("editor"); ace.require("ace/ext/settings_menu").init(editor); editor.session.setMode("ace/mode/java"); editor.setOptions({ theme: "ace/theme/tomorrow_night_bright" }); editor.on('changeTheme', function() { -> This is not working console.log(editor.mode) })
I tried change theme event and using $("#-theme").change()
event but it doesn't work
P粉1037395662023-09-11 15:46:20
There are themeChange and themeLoaded events on
editor.renderer, see https://github.com/ajaxorg/ace/blob/31bbd6ade094c1e142565837a4ee93c7931399a4/src/virtual_renderer.js#L1721
editor.renderer.on('themeChange', function() { // theme setting changed }) editor.renderer.on('themeLoaded', function() { // theme loaded and applied to editor })