When changing steps on both editors reset the scroll
This commit is contained in:
parent
d40265544d
commit
fbff31d287
|
@ -879,14 +879,21 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
||||||
|
|
||||||
public changeStep(index: number, dataset?: FormControl) {
|
public changeStep(index: number, dataset?: FormControl) {
|
||||||
this.step = index;
|
this.step = index;
|
||||||
|
this.resetScroll();
|
||||||
}
|
}
|
||||||
|
|
||||||
public nextStep() {
|
public nextStep() {
|
||||||
this.step = this.step < this.maxStep ? this.step + 1 : this.step;
|
this.step = this.step < this.maxStep ? this.step + 1 : this.step;
|
||||||
|
this.resetScroll();
|
||||||
}
|
}
|
||||||
|
|
||||||
public previousStep() {
|
public previousStep() {
|
||||||
this.step = this.step !== 0 ? this.step - 1 : this.step;
|
this.step = this.step !== 0 ? this.step - 1 : this.step;
|
||||||
|
this.resetScroll();
|
||||||
|
}
|
||||||
|
|
||||||
|
private resetScroll() {
|
||||||
|
document.getElementById('dataset-editor-form').scrollTop = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
isDirty() {
|
isDirty() {
|
||||||
|
|
|
@ -823,11 +823,13 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
||||||
|
|
||||||
public changeStep(index: number, dataset?: FormControl) {
|
public changeStep(index: number, dataset?: FormControl) {
|
||||||
this.step = index;
|
this.step = index;
|
||||||
|
this.resetScroll();
|
||||||
if (dataset) { this.datasetId = dataset.get('id').value };
|
if (dataset) { this.datasetId = dataset.get('id').value };
|
||||||
}
|
}
|
||||||
|
|
||||||
public nextStep() {
|
public nextStep() {
|
||||||
this.step = this.step < this.maxStep ? this.step + 1 : this.step;
|
this.step = this.step < this.maxStep ? this.step + 1 : this.step;
|
||||||
|
this.resetScroll();
|
||||||
if (this.step >= this.stepsBeforeDatasets) {
|
if (this.step >= this.stepsBeforeDatasets) {
|
||||||
this.datasetId = this.datasets.at(this.step - this.stepsBeforeDatasets).get('id').value;
|
this.datasetId = this.datasets.at(this.step - this.stepsBeforeDatasets).get('id').value;
|
||||||
}
|
}
|
||||||
|
@ -835,11 +837,16 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
||||||
|
|
||||||
public previousStep() {
|
public previousStep() {
|
||||||
this.step = this.step !== 0 ? this.step - 1 : this.step;
|
this.step = this.step !== 0 ? this.step - 1 : this.step;
|
||||||
|
this.resetScroll();
|
||||||
if (this.step >= this.stepsBeforeDatasets) {
|
if (this.step >= this.stepsBeforeDatasets) {
|
||||||
this.datasetId = this.datasets.at(this.step - this.stepsBeforeDatasets).get('id').value;
|
this.datasetId = this.datasets.at(this.step - this.stepsBeforeDatasets).get('id').value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private resetScroll() {
|
||||||
|
document.getElementById('editor-form').scrollTop = 0;
|
||||||
|
}
|
||||||
|
|
||||||
public isDirty(): boolean {
|
public isDirty(): boolean {
|
||||||
return this.formGroup.dirty && this.hasChanges; // do we need this.formGroup.dirty
|
return this.formGroup.dirty && this.hasChanges; // do we need this.formGroup.dirty
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue