|
|
@@ -42,7 +42,25 @@ CKEDITOR.define( [ 'treeview/observer/observer' ], ( Observer ) => {
|
|
|
this._mutationObserver.disconnect();
|
|
|
}
|
|
|
|
|
|
- // _onMutations( mutations ) {}
|
|
|
+ _onMutations( mutations ) {
|
|
|
+ const mutatedTexts = new Set();
|
|
|
+ const mutatedElements = new Set();
|
|
|
+
|
|
|
+ for ( let mutation of mutations ) {
|
|
|
+ if ( mutation.type === 'characterData' ) {
|
|
|
+ mutatedTexts.add( mutation.target );
|
|
|
+ } else if ( mutation.type === 'childList' ) {
|
|
|
+ mutatedElements.add( mutation.target );
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for ( let text of mutatedTexts ) {
|
|
|
+ if ( !mutatedElements.has( text.parent ) ) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.treeView.render();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return MutationObserver;
|