소스 검색

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());
   });