Skip to content

Commit

Permalink
Merge pull request #327 from devgeniem/fix/mobile-nav
Browse files Browse the repository at this point in the history
Fix/mobile-nav: Fix hamburger menu toggle, attempt #2
  • Loading branch information
Viljami Hirvonen authored Dec 22, 2021
2 parents caecdb8 + 9ac0daa commit 39442cd
Show file tree
Hide file tree
Showing 5 changed files with 609 additions and 292 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Changed

- Revert "Downgrade image-webpack-loader"
- fix/mobile-nav: Fix issue where user was unable to close fly out navigation in mobile

## [1.31.2]

### Changed
Expand Down
16 changes: 1 addition & 15 deletions assets/scripts/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,11 @@ export default class Header {
*/
docReady() {
$( '.site-header-notice__close' ).on( 'click', this.onNoticeClose.bind( this ) );
$( '.fly-out-nav__close' ).on( 'click', this.closeFlyOutMenu.bind( this ) );
$( '.fly-out-nav .js-scroll-children' ).on( 'click', this.closeFlyOutMenu.bind( this ) );

const modalTrigger = $( '.fly-out-nav__trigger' );

MicroModal.init( {
disableScroll: true,
onShow: () => {
const isDisabled = modalTrigger.attr( 'disabled' );

modalTrigger.attr( 'disabled', ! isDisabled );
this.onFlyOutMenuOpen.bind( this );
},
onClose: () => {
const isDisabled = modalTrigger.attr( 'disabled' );

window.setTimeout( () => {
modalTrigger.attr( 'disabled', ! isDisabled );
}, 25 );
},
} );

this.maybeShowGeneralNotification();
Expand Down
Loading

0 comments on commit 39442cd

Please sign in to comment.