From b6236b7e0d8a2d374504054952265e1277c41e1a Mon Sep 17 00:00:00 2001 From: Kristan Ntavidi Date: Tue, 23 Mar 2021 13:52:33 +0200 Subject: [PATCH] Dataset Profile editor . Scroll timing Fix --- .../editor/animations/animations.ts | 14 +++++++++- ...ofile-editor-section-fieldset.component.ts | 28 +++++++++---------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/animations/animations.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/animations/animations.ts index 3c3648e3d..4cd957557 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/animations/animations.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/animations/animations.ts @@ -44,4 +44,16 @@ export const STEPPER_ANIMATIONS = [ animate('600ms ease-in', style({opacity:0.3})) ]) ]) -]; \ No newline at end of file +]; +export const GENERAL_ANIMATIONS = [ + trigger('enterIn',[ + transition(':enter',[ + style({ + transform:'scale(0)', + 'transform-origin':'50% 0', + opacity:0 + }), + animate('800ms ease', style({transform:'scale(1)', opacity:1})) + ]) + ]) +] \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component.ts index 4257b6517..10365e5b1 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component.ts @@ -137,23 +137,21 @@ export class DatasetProfileEditorSectionFieldSetComponent implements OnInit, OnC let el = this.myElement.nativeElement.querySelector("#"+this.idprefix+id); // let el = this.myElement.nativeElement.getElementbyId (this.selectedFieldSetId); - if(el){ + if(el){ - /* - Give time to template to build itself (extending and collapsing). - In case we are dragging from one container to another, then the ui takes around 600ms to build - individual previews (dataset-profile-editor-field.component.ts); + /* + Give time to template to build itself (extending and collapsing). + In case we are dragging from one container to another, then the ui takes around 600ms to build + individual previews (dataset-profile-editor-field.component.ts); - */ - setTimeout(() => { - const el = this.myElement.nativeElement.querySelector("#"+this.idprefix+id); - if(el){ - el.scrollIntoView({behavior: "smooth"}); - } - }, 1100); - }else{ - this._scrollOnTop(); - } + */ + setTimeout(() => { + const el = this.myElement.nativeElement.querySelector("#"+this.idprefix+id); + if(el){ + el.scrollIntoView({behavior: "smooth"}); + } + }, 700); + } } private _scrollOnTop(){