Skip to content

Commit

Permalink
Ensuring we always enqueue any required css
Browse files Browse the repository at this point in the history
  • Loading branch information
CWDN committed Jul 12, 2024
1 parent da9863e commit b91505c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 4 additions & 0 deletions assets/css/cwby-component-disabled.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.gc-component-disabled {
pointer-events: none;
opacity: 0.5;
}
1 change: 1 addition & 0 deletions assets/css/cwby-component-disabled.min.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.gc-component-disabled{pointer-events:none;opacity:.5}
2 changes: 2 additions & 0 deletions includes/classes/admin/mapping-wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,8 @@ public function map_template() {
}

if ( $template_has_repeatable_fields && ! $is_acf_pro_installed ) {
\GatherContent\Importer\enqueue_style('cwby-component-disabled', 'cwby-component-disabled');

$notes .= $this->view(
'graceful-degradation',
array( 'additionalClass' => 'gc-component-disabled' ),
Expand Down
6 changes: 0 additions & 6 deletions includes/views/graceful-degradation.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,3 @@
<div class="notice notice-error is-dismissible">
<p><?php esc_html_e( 'Repeatable content mapping requires the installation of Advanced Custom Fields Pro WordPress Plugin. To enable this functionality, please install and refresh the page.', 'content-workflow-by-bynder' ); ?></p>
</div>
<style>
.gc-component-disabled {
pointer-events: none;
opacity: 0.5;
}
</style>
2 changes: 1 addition & 1 deletion tasks/options/cssmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
expand: true,

cwd: 'assets/css/',
src: ['gathercontent-importer.css'],
src: ['gathercontent-importer.css', 'cwby-component-disabled.css'],

dest: 'assets/css/',
ext: '.min.css'
Expand Down

0 comments on commit b91505c

Please sign in to comment.