Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions projects/angular-editor-app/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<base href="/">

<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
>
</div>
Expand Down
4 changes: 2 additions & 2 deletions projects/angular-editor/src/lib/angular-editor.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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 = '<a href="' + url + '" target="_blank">' + this.selectedText + '</a>';
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es2015",
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
Expand All @@ -27,4 +27,4 @@
]
}
}
}
}