Do not reset WYSIWYG editor to beginning on save (#21)
This commit is contained in:
parent
d7b2b3156c
commit
74b7cdadc7
@ -13,6 +13,7 @@ export class NormComponent extends EditorNodeContract implements OnInit {
|
||||
|
||||
public isFocused = false;
|
||||
public initialValue = 'Click to edit...';
|
||||
protected savedValue = 'Click to edit...';
|
||||
public contents = '';
|
||||
private dirtyOverride = false;
|
||||
|
||||
@ -21,15 +22,16 @@ export class NormComponent extends EditorNodeContract implements OnInit {
|
||||
) {
|
||||
super();
|
||||
this.contents = this.initialValue;
|
||||
this.savedValue = this.initialValue;
|
||||
}
|
||||
|
||||
public isDirty(): boolean | Promise<boolean> {
|
||||
return this.dirtyOverride || this.contents !== this.initialValue;
|
||||
return this.dirtyOverride || this.contents !== this.savedValue;
|
||||
}
|
||||
|
||||
public writeChangesToNode(): void | Promise<void> {
|
||||
this.nodeRec.value = this.contents;
|
||||
this.initialValue = this.contents;
|
||||
this.savedValue = this.contents;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@ -40,7 +42,9 @@ export class NormComponent extends EditorNodeContract implements OnInit {
|
||||
|
||||
if ( this.node.Value.Value ) {
|
||||
this.initialValue = this.node.Value.Value;
|
||||
this.savedValue = this.node.Value.Value;
|
||||
}
|
||||
|
||||
this.contents = this.initialValue;
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user