0
CKEditor에 문서가 있고 CKEditor 외부에 측면 탐색이 있습니다. CKEditor에서 문서의 섹션이 스크롤 될 때 특정 nav (강조 표시)를 강조하고 싶습니다.각도 2의 ckeditor에 대한 스파이 검색
details.component.ts
focusFunction() {
if (window['CKEDITOR'].instances['Doc'] == undefined) {
window['CKEDITOR']['inline']('Doc');
}
}
ngOnDestroy() {
this.sub.unsubscribe();
if (window['CKEDITOR'].instances['Doc'] != undefined) {
window['CKEDITOR'].instances['Doc'].destroy(true);
}
}
details.html
<ul class="nav nav-vertical dls-nav">
<li ng-repeat="entry in leftNav" *ngFor="let entry of leftNav | keys; let i=index " (click)="addActiveClass(i)" [ngClass]="{'active': highlightedDiv === i ,'nav-item no-border' :true }">
<a id="nav_{{i}}" [href]="'#'+entry.key" class="nav-link">{{entry.value}}</a>
</li>
</ul>
<div id="Doc" [attr.contenteditable]="isEditable" class="container" style="text-align: left; position: relative;" [innerHTML]="documentation | sanitizeHtml" (focus)="focusFunction()">