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
5 changes: 4 additions & 1 deletion projects/angular-editor/src/lib/angular-editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ export class AngularEditorComponent implements OnInit, ControlValueAccessor, Aft

ngOnInit() {
this.config.toolbarPosition = this.config.toolbarPosition ? this.config.toolbarPosition : angularEditorConfig.toolbarPosition;
if (this.config.styleWithCSS) {
this.doc.execCommand('styleWithCSS', null, true);
}
}

ngAfterViewInit() {
Expand All @@ -108,7 +111,7 @@ export class AngularEditorComponent implements OnInit, ControlValueAccessor, Aft
if (this.config.rawPaste) {
event.preventDefault();
const text = event.clipboardData.getData('text/plain');
document.execCommand('insertHTML', false, text);
this.doc.execCommand('insertHTML', false, text);
return text;
}
}
Expand Down
2 changes: 2 additions & 0 deletions projects/angular-editor/src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export interface AngularEditorConfig {
customClasses?: CustomClass[];
sanitize?: boolean;
toolbarPosition?: 'top' | 'bottom';
styleWithCSS?: boolean;
outline?: boolean;
toolbarHiddenButtons?: string[][];
rawPaste?: boolean;
Expand Down Expand Up @@ -65,6 +66,7 @@ export const angularEditorConfig: AngularEditorConfig = {
uploadWithCredentials: false,
sanitize: true,
toolbarPosition: 'top',
styleWithCSS: false,
outline: true,
/*toolbarHiddenButtons: [
['bold', 'italic', 'underline', 'strikeThrough', 'superscript', 'subscript'],
Expand Down