Skip to content

Commit

Permalink
Merge pull request #631 from geonetwork/nav-menu-hide
Browse files Browse the repository at this point in the history
Datahub: Hide nav menu on scroll down
  • Loading branch information
tkohr authored Sep 22, 2023
2 parents 24bf196 + 63084d8 commit 6733dec
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
11 changes: 9 additions & 2 deletions apps/datahub-e2e/src/e2e/header.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ describe('header', () => {
.click({ force: true })
cy.url().should('include', '/organisations')
})
it('hide navigation buttons when scrolling down', () => {
cy.scrollTo(0, 1000)
cy.get('datahub-navigation-menu')
.find('button')
.eq(0)
.should('not.be.visible')
})
})

describe('search actions', () => {
Expand Down Expand Up @@ -114,15 +121,15 @@ describe('header', () => {
it('should sort results by latest date', () => {
cy.get('gn-ui-fuzzy-search').next().find('button').first().click()
cy.get('gn-ui-record-preview-row').should('not.eq', '@initialList')
cy.get('select#sort-by- option:selected').should(
cy.get('gn-ui-sort-by option:selected').should(
'have.value',
'desc,createDate'
)
})
it('should filter results by popularity', () => {
cy.get('gn-ui-fuzzy-search').next().find('button').eq(1).click()
cy.get('gn-ui-record-preview-row').should('not.eq', '@initialList')
cy.get('select#sort-by- option:selected').should(
cy.get('gn-ui-sort-by option:selected').should(
'have.value',
'desc,userSavedCount'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@
></datahub-header-badge-button>
</div>
-->
<datahub-navigation-menu
class="tabs flex justify-between font-medium -mx-5 sm:mx-0 sm:mt-32 inset-x-0 bottom-0 z-50"
[style.opacity]="-0.6 + expandRatio * 5"
></datahub-navigation-menu>
<div [style.opacity]="-0.6 + expandRatio * 5">
<datahub-navigation-menu
class="tabs flex justify-between font-medium -mx-5 sm:mx-0 sm:mt-32 inset-x-0 bottom-0 z-50"
></datahub-navigation-menu>
</div>
</div>
<gn-ui-language-switcher
*ngIf="showLanguageSwitcher"
Expand Down

0 comments on commit 6733dec

Please sign in to comment.