Loading app/tinymce.component.ts +2 −5 Original line number Diff line number Diff line Loading @@ -25,10 +25,7 @@ export class TinyMCE { @Input() htmlContent; @ViewChild(Mention) mention: Mention; protected items:string [] = COMMON_NAMES; private zone:NgZone; constructor(private _elementRef: ElementRef) { this.zone = new NgZone({enableLongStackTrace: false}); } constructor(private _elementRef: ElementRef, private _zone: NgZone) {} ngAfterViewInit() { tinymce.init({ Loading @@ -52,7 +49,7 @@ export class TinyMCE { ed.on('keydown', function(e) { let frame = <any>window.frames[ed.iframeElement.id]; let contentEditable = frame.contentDocument.getElementById('tinymce'); comp.zone.run(() => { comp._zone.run(() => { comp.mention.keyHandler(e, contentEditable); }); }); Loading mention/mention.ts +8 −2 Original line number Diff line number Diff line Loading @@ -88,8 +88,14 @@ export class Mention { if (event.keyCode === KEY_TAB || event.keyCode === KEY_ENTER) { this.stopEvent(event); this.searchList.hidden = true; insertValue(nativeElement, this.mentionStart, pos, "@"+this.searchList.activeItem+" ", this.iframe); insertValue(nativeElement, this.mentionStart, pos, "@"+this.searchList.activeItem+" ", this.iframe); // fire input event so angular bindings are updated if ("createEvent" in document) { var evt = document.createEvent("HTMLEvents"); evt.initEvent("input", false, true); nativeElement.dispatchEvent(evt); } this.mentionStart = -1; return false; } Loading Loading
app/tinymce.component.ts +2 −5 Original line number Diff line number Diff line Loading @@ -25,10 +25,7 @@ export class TinyMCE { @Input() htmlContent; @ViewChild(Mention) mention: Mention; protected items:string [] = COMMON_NAMES; private zone:NgZone; constructor(private _elementRef: ElementRef) { this.zone = new NgZone({enableLongStackTrace: false}); } constructor(private _elementRef: ElementRef, private _zone: NgZone) {} ngAfterViewInit() { tinymce.init({ Loading @@ -52,7 +49,7 @@ export class TinyMCE { ed.on('keydown', function(e) { let frame = <any>window.frames[ed.iframeElement.id]; let contentEditable = frame.contentDocument.getElementById('tinymce'); comp.zone.run(() => { comp._zone.run(() => { comp.mention.keyHandler(e, contentEditable); }); }); Loading
mention/mention.ts +8 −2 Original line number Diff line number Diff line Loading @@ -88,8 +88,14 @@ export class Mention { if (event.keyCode === KEY_TAB || event.keyCode === KEY_ENTER) { this.stopEvent(event); this.searchList.hidden = true; insertValue(nativeElement, this.mentionStart, pos, "@"+this.searchList.activeItem+" ", this.iframe); insertValue(nativeElement, this.mentionStart, pos, "@"+this.searchList.activeItem+" ", this.iframe); // fire input event so angular bindings are updated if ("createEvent" in document) { var evt = document.createEvent("HTMLEvents"); evt.initEvent("input", false, true); nativeElement.dispatchEvent(evt); } this.mentionStart = -1; return false; } Loading