Skip to content

Commit

Permalink
[#148] Fixing some small bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-schmidt-viget committed Nov 11, 2024
1 parent 6e7f815 commit fb653d7
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 34 deletions.
2 changes: 1 addition & 1 deletion wp-content/themes/wp-starter/blocks/dialog/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"attributes": {
"align": {
"type": "string",
"default": "full"
"default": "wide"
}
},
"supports": {
Expand Down
2 changes: 1 addition & 1 deletion wp-content/themes/wp-starter/blocks/dialog/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}

.acfbt-dialog-label {
@apply block cursor-pointer;
@apply mb-24 block cursor-pointer;
}

.acfbt-dialog-checkbox {
Expand Down
64 changes: 32 additions & 32 deletions wp-content/themes/wp-starter/blocks/dialog/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,39 +35,39 @@
<?php endif; ?>
>

<dialog
<?php block_attrs( $block ); ?>
<?php if ( ! is_admin() ) : ?>
x-ref="dialogRef"
@keydown.escape.prevent="handleDialogClose()"
@click="handleDialogClick(event)"
<?php endif; ?>
>
<?php if ( ! is_admin() ) : ?>
<button
class="acf-dialog-close"
@click="handleDialogClose()"
>
<span class="sr-only"><?php esc_html_e( 'Close', 'wp-site-starter' ); ?></span>
</button>
<?php endif; ?>

<div class="inner">
<?php if ( is_admin() ) : ?>
<label for="<?php echo esc_attr( $cbx_id ); ?>" class="acfbt-dialog-close">
<dialog
<?php block_attrs( $block ); ?>
<?php if ( ! is_admin() ) : ?>
x-ref="dialogRef"
@keydown.escape.prevent="handleDialogClose()"
@click="handleDialogClick(event)"
<?php endif; ?>
>
<?php if ( ! is_admin() ) : ?>
<button
class="acf-dialog-close"
@click="handleDialogClose()"
>
<span class="sr-only"><?php esc_html_e( 'Close', 'wp-site-starter' ); ?></span>
</label>
</button>
<?php endif; ?>
<?php inner_blocks(); ?>
</div>
</dialog>

<button
class="btn-default"
<?php if ( ! is_admin() ) : ?>
@click="$refs.dialogRef.showModal(), openDialog = true"
<?php endif; ?>
>
<?php esc_html_e( $button_text ? $button_text : 'Open', 'wp-site-starter' ); ?>
</button>
<div class="inner">
<?php if ( is_admin() ) : ?>
<label for="<?php echo esc_attr( $cbx_id ); ?>" class="acfbt-dialog-close">
<span class="sr-only"><?php esc_html_e( 'Close', 'wp-site-starter' ); ?></span>
</label>
<?php endif; ?>
<?php inner_blocks(); ?>
</div>
</dialog>

<button
class="btn-default"
<?php if ( ! is_admin() ) : ?>
@click="$refs.dialogRef.showModal(), openDialog = true"
<?php endif; ?>
>
<?php esc_html_e( $button_text ? $button_text : 'Open', 'wp-site-starter' ); ?>
</button>
</div>
1 change: 1 addition & 0 deletions wp-content/themes/wp-starter/blocks/dialog/render.twig
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
</div>
</dialog>


<button
class="btn-default"
{% if function('is_admin') == false %}
Expand Down

0 comments on commit fb653d7

Please sign in to comment.