Skip to content

Commit

Permalink
Try renaming the view file (unsucessful)
Browse files Browse the repository at this point in the history
  • Loading branch information
luisherranz committed Sep 27, 2022
1 parent 9195ddf commit 13da68a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/navigation/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
}
}
},
"viewScript": [ "file:./view.min.js" ],
"viewScript": [ "file:./wordpress-directives.min.js" ],
"editorStyle": "wp-block-navigation-editor",
"style": "wp-block-navigation"
}
10 changes: 3 additions & 7 deletions packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,14 +421,10 @@ function render_block_core_navigation( $attributes, $content, $block ) {
*/
$has_old_responsive_attribute = ! empty( $attributes['isResponsive'] ) && $attributes['isResponsive'];
$is_responsive_menu = isset( $attributes['overlayMenu'] ) && 'never' !== $attributes['overlayMenu'] || $has_old_responsive_attribute;
$should_load_view_script = ! wp_script_is( 'wp-block-navigation-view' ) && ( $is_responsive_menu || $attributes['openSubmenusOnClick'] || $attributes['showSubmenuIcon'] );
if ( $should_load_view_script ) {
wp_enqueue_script( 'wp-block-navigation-view' );
}

$should_load_modal_view_script = isset( $attributes['overlayMenu'] ) && 'never' !== $attributes['overlayMenu'];
if ( $should_load_modal_view_script ) {
wp_enqueue_script( 'wp-block-navigation-view-modal' );
$should_load_view_script = ! wp_script_is( 'wp-block-navigation-wordpress-directives' ) && ( $is_responsive_menu || $attributes['openSubmenusOnClick'] || $attributes['showSubmenuIcon'] );
if ( $should_load_view_script ) {
wp_enqueue_script( 'wp-block-navigation-wordpress-directives' );
}

$inner_blocks = $block->inner_blocks;
Expand Down

0 comments on commit 13da68a

Please sign in to comment.