瀏覽代碼

filter notifyBodyChanges

Yuki Takei 7 年之前
父節點
當前提交
3dc5dbf2f7
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      resource/js/hackmd-agent.js

+ 4 - 0
resource/js/hackmd-agent.js

@@ -88,6 +88,10 @@ function addEventListenersToCodemirror() {
 
   //// change event
   editor.on('change', (cm, change) => {
+    if (change.origin === 'ignoreHistory') {
+      // do nothing because this operation triggered by other user
+      return;
+    }
     debouncedPostParentToNotifyBodyChanges(cm.doc.getValue());
   });