diff --git a/projects/angular-editor-app/src/index.html b/projects/angular-editor-app/src/index.html index df04b3521..9cf4f86dd 100644 --- a/projects/angular-editor-app/src/index.html +++ b/projects/angular-editor-app/src/index.html @@ -6,6 +6,7 @@ + diff --git a/projects/angular-editor/src/lib/angular-editor-toolbar.component.ts b/projects/angular-editor/src/lib/angular-editor-toolbar.component.ts index d89b612c1..2e9d99b4e 100644 --- a/projects/angular-editor/src/lib/angular-editor-toolbar.component.ts +++ b/projects/angular-editor/src/lib/angular-editor-toolbar.component.ts @@ -112,7 +112,7 @@ export class AngularEditorToolbarComponent { select = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'P', 'PRE', 'DIV']; buttons = ['bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', 'justifyLeft', 'justifyCenter', - 'justifyRight', 'justifyFull', 'indent', 'outdent', 'insertUnorderedList', 'insertOrderedList', 'link']; + 'justifyRight', 'justifyFull', 'indent', 'outdent', 'insertUnorderedList', 'insertOrderedList']; @Input() id: string; @Input() uploadUrl: string; diff --git a/projects/angular-editor/src/lib/angular-editor.component.html b/projects/angular-editor/src/lib/angular-editor.component.html index e36c5c3de..8003b0cc7 100644 --- a/projects/angular-editor/src/lib/angular-editor.component.html +++ b/projects/angular-editor/src/lib/angular-editor.component.html @@ -21,11 +21,10 @@ [style.minHeight]="config.minHeight" [style.maxHeight]="config.maxHeight" [style.outline]="config.outline === false ? 'none': undefined" - (input)="onContentChange($event.target)" (focus)="onTextAreaFocus($event)" (blur)="onTextAreaBlur($event)" (click)="exec()" - (keyup)="exec()" + (keyup)="exec();onContentChange($event.target)" (mouseout)="onTextAreaMouseOut($event)" > diff --git a/projects/angular-editor/src/lib/angular-editor.service.ts b/projects/angular-editor/src/lib/angular-editor.service.ts index 8c021321c..9b5373253 100644 --- a/projects/angular-editor/src/lib/angular-editor.service.ts +++ b/projects/angular-editor/src/lib/angular-editor.service.ts @@ -29,7 +29,7 @@ export class AngularEditorService { */ executeCommand(command: string) { const commands = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'pre']; - if (commands.includes(command)) { + if (commands.indexOf(command) > -1) { this.doc.execCommand('formatBlock', false, command); return; } @@ -41,7 +41,7 @@ export class AngularEditorService { * @param url string from UI prompt */ createLink(url: string) { - if (!url.includes('http')) { + if (!(url.indexOf('http') > -1)) { this.doc.execCommand('createlink', false, url); } else { const newUrl = '' + this.selectedText + ''; diff --git a/tsconfig.json b/tsconfig.json index 2c8441cea..f27989334 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,7 @@ "emitDecoratorMetadata": true, "experimentalDecorators": true, "importHelpers": true, - "target": "es2015", + "target": "es5", "typeRoots": [ "node_modules/@types" ], @@ -27,4 +27,4 @@ ] } } -} \ No newline at end of file +}