-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Responsive Navigation #30047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Responsive Navigation #30047
Changes from 1 commit
6d9f03b
885fcb5
fa50591
f433a9a
7729c3f
ab29f51
6ea6ed1
f40546d
0c2a4dc
3df9544
a7dac30
2eb3b68
82f85e1
f80f54a
d22e43d
3808578
637bb09
2cd59a7
ccd361f
dadce1c
a59dff6
986c192
bc9bb9c
0d12f7c
a12aeea
7065648
5da3bfd
1b9885f
dd97947
dc9d315
516e7a6
10adcaa
4b0ecda
b2990cd
2769bd2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -122,7 +122,7 @@ function render_block_core_navigation( $attributes, $content, $block ) { | |
| unset( $attributes['rgbTextColor'], $attributes['rgbBackgroundColor'] ); | ||
|
|
||
| $script_path = __DIR__ . '/navigation/frontend.js'; | ||
vcanales marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| $should_load_frontend_script = $attributes['responsiveNavigation'] && ! wp_script_is( 'core_block_navigation_load_frontend_scripts' ) && file_exists( $script_path ); | ||
| $should_load_frontend_script = $attributes['isResponsive'] && ! wp_script_is( 'core_block_navigation_load_frontend_scripts' ) && file_exists( $script_path ); | ||
ntsekouras marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| if ( $should_load_frontend_script ) { | ||
| wp_enqueue_script( | ||
|
|
@@ -145,7 +145,7 @@ function render_block_core_navigation( $attributes, $content, $block ) { | |
| $font_sizes['css_classes'], | ||
| ( isset( $attributes['orientation'] ) && 'vertical' === $attributes['orientation'] ) ? array( 'is-vertical' ) : array(), | ||
| isset( $attributes['itemsJustification'] ) ? array( 'items-justified-' . $attributes['itemsJustification'] ) : array(), | ||
| isset( $attributes['responsiveNavigation'] ) && true === $attributes['responsiveNavigation'] ? array( 'is-responsive' ) : array() | ||
| isset( $attributes['isResponsive'] ) && true === $attributes['isResponsive'] ? array( 'is-responsive' ) : array() | ||
| ); | ||
|
|
||
| $inner_blocks_html = ''; | ||
|
|
@@ -165,7 +165,7 @@ function render_block_core_navigation( $attributes, $content, $block ) { | |
| $modal_unique_id = uniqid(); | ||
|
|
||
| // Determine whether or not navigation elements should be wrapped in the markup required to make it responsive. | ||
vcanales marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| $responsive_container_markup = isset( $attributes['responsiveNavigation'] ) && true === $attributes['responsiveNavigation'] ? sprintf( | ||
| $responsive_container_markup = isset( $attributes['isResponsive'] ) && true === $attributes['isResponsive'] ? sprintf( | ||
vcanales marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| '<button class="wp-block-navigation__responsive-container-open" data-micromodal-trigger="modal-%2$s" aria-label="Open menu"><svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-hidden="true" focusable="false"><rect x="4" y="7.5" width="16" height="1.5" /><rect x="4" y="15" width="16" height="1.5" /></svg></button> | ||
|
||
| <div class="wp-block-navigation__responsive-container" id="modal-%2$s" aria-hidden="true"> | ||
| <div class="wp-block-navigation__responsive-close" tabindex="-1" data-micromodal-close> | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.