Skip to content

Commit

Permalink
Merge pull request #2395 from ORCID/scroll-to-top-on-email-interstitial
Browse files Browse the repository at this point in the history
scroll to top on email interstitial
  • Loading branch information
gilesw authored Nov 12, 2024
2 parents 145fd12 + 3ca10ef commit d79ec42
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { ShareEmailsDomainsComponent } from './share-emails-domains.component'
import { FormBuilder, FormControl, FormGroup } from '@angular/forms'
import { RecordEmailsService } from 'src/app/core/record-emails/record-emails.service'
import { PlatformInfoService } from '../../platform-info'
import { WINDOW_PROVIDERS } from '../../window'
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'

describe('ShareEmailsDomainsComponent', () => {
let component: ShareEmailsDomainsComponent
Expand All @@ -28,7 +30,9 @@ describe('ShareEmailsDomainsComponent', () => {
provide: RecordEmailsService,
useValue: {},
},
WINDOW_PROVIDERS,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
fixture = TestBed.createComponent(ShareEmailsDomainsComponent)
component = fixture.componentInstance
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Component, EventEmitter, Input, Output } from '@angular/core'
import { Component, EventEmitter, Inject, Input, Output } from '@angular/core'
import { PlatformInfoService } from '../../platform-info'
import { AssertionVisibilityString, EmailsEndpoint } from 'src/app/types'
import { FormBuilder, FormControl, FormGroup } from '@angular/forms'
import { RecordEmailsService } from 'src/app/core/record-emails/record-emails.service'
import { error } from 'console'
import { WINDOW } from '../../window'

@Component({
selector: 'app-share-emails-domains',
Expand All @@ -23,12 +24,14 @@ export class ShareEmailsDomainsComponent {
constructor(
public platformInfo: PlatformInfoService,
private fb: FormBuilder,
private recordEmailsService: RecordEmailsService
private recordEmailsService: RecordEmailsService,
@Inject(WINDOW) private window: Window
) {}
public loadingEmails = true
@Output() finish = new EventEmitter<void>()

ngOnInit() {
this.window.scrollTo(0, 0)
this.userPrivateDomains = this.getTop3MostRecentPrivateDomains(
this.userEmailsJson
)
Expand Down

0 comments on commit d79ec42

Please sign in to comment.