MCPcopy Create free account
hub / github.com/TruthHun/BookStack / doOnchange

Function doOnchange

static/wangEditor/js/wangEditor.js:2838–2855  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2836
2837 // 触发 onchange 事件
2838 function doOnchange() {
2839 var val = $txt.html();
2840 if (oldValue === val) {
2841 // 无变化
2842 return;
2843 }
2844
2845 // 触发 onchange 事件
2846 if (editor.onchange && typeof editor.onchange === 'function') {
2847 editor.onchange.call(editor);
2848 }
2849
2850 // 更新内容
2851 editor.updateValue();
2852
2853 // 记录最新内容
2854 oldValue = val;
2855 }
2856
2857 // txt change 时随时更新内容
2858 $txt.on(txtChangeEventNames, function (e) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected