From b91505c257ac9a6501868c9b5fff5f14f27726f6 Mon Sep 17 00:00:00 2001 From: Chris Normansell Date: Fri, 12 Jul 2024 11:05:07 +0100 Subject: [PATCH] Ensuring we always enqueue any required css --- assets/css/cwby-component-disabled.css | 4 ++++ assets/css/cwby-component-disabled.min.css | 1 + includes/classes/admin/mapping-wizard.php | 2 ++ includes/views/graceful-degradation.php | 6 ------ tasks/options/cssmin.js | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 assets/css/cwby-component-disabled.css create mode 100644 assets/css/cwby-component-disabled.min.css diff --git a/assets/css/cwby-component-disabled.css b/assets/css/cwby-component-disabled.css new file mode 100644 index 00000000..26a6806b --- /dev/null +++ b/assets/css/cwby-component-disabled.css @@ -0,0 +1,4 @@ +.gc-component-disabled { + pointer-events: none; + opacity: 0.5; +} diff --git a/assets/css/cwby-component-disabled.min.css b/assets/css/cwby-component-disabled.min.css new file mode 100644 index 00000000..c51c82a3 --- /dev/null +++ b/assets/css/cwby-component-disabled.min.css @@ -0,0 +1 @@ +.gc-component-disabled{pointer-events:none;opacity:.5} \ No newline at end of file diff --git a/includes/classes/admin/mapping-wizard.php b/includes/classes/admin/mapping-wizard.php index 16d7f7b7..ba0dd4e8 100644 --- a/includes/classes/admin/mapping-wizard.php +++ b/includes/classes/admin/mapping-wizard.php @@ -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' ), diff --git a/includes/views/graceful-degradation.php b/includes/views/graceful-degradation.php index df8f4298..03434d0d 100644 --- a/includes/views/graceful-degradation.php +++ b/includes/views/graceful-degradation.php @@ -2,9 +2,3 @@

- diff --git a/tasks/options/cssmin.js b/tasks/options/cssmin.js index c57b20eb..6495da6a 100644 --- a/tasks/options/cssmin.js +++ b/tasks/options/cssmin.js @@ -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'