Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
iandunn committed Apr 12, 2023
1 parent 2c3cc14 commit 61f742a
Show file tree
Hide file tree
Showing 67 changed files with 24 additions and 13,152 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions wp-content/mu-plugins/assets/locale-switcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
app.$container = $( '.navigation-top-menu-container' );
app.$outerContainer = $( '.wp20-locale-switcher-container' );

app.$switcher.selectWoo( {
language: app.locale,
dir: app.dir,
dropdownParent: app.$container,
width: 'auto',
dropdownAutoWidth : true
} );
// todo enable a11yautocom here
accessibleAutocomplete.enhanceSelectElement( {
selectElement: document.querySelector( '#wp20-locale-switcher' ),
showAllValues: true,
// any others? look at docs/examples
} )

app.$switcher.on( 'change', function() {
$(this).parents( 'form' ).submit();
} );

// This has to stay `select2`; `selectWoo:open` will not work.
app.$switcher.on( 'select2:open', function() {
// todo: update for new lib
app.$container.find( 'input' ).attr( 'placeholder', app.$container.attr( 'data-placeholder' ) );

// Turn off the menu if it's open.
Expand Down
Loading

0 comments on commit 61f742a

Please sign in to comment.