From f42d50b8be403020e66a16bbe7adf09fc63afb43 Mon Sep 17 00:00:00 2001 From: "stephen@cubedesigners.com" Date: Mon, 4 May 2020 14:27:30 +0000 Subject: [PATCH] Fix #3628 @0.75 --- .../physioassist/src/Elementor/Widgets/ModalList.php | 4 +++- .../physioassist/src/Elementor/Widgets/ProfileGrid.php | 4 +++- wp-content/themes/physioassist/resources/assets/config.json | 3 +++ .../themes/physioassist/resources/assets/scripts/lity.js | 2 ++ .../physioassist/resources/assets/scripts/modal-list.js | 2 -- .../physioassist/resources/assets/scripts/profile-grid.js | 1 - 6 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 wp-content/themes/physioassist/resources/assets/scripts/lity.js diff --git a/wp-content/mu-plugins/physioassist/src/Elementor/Widgets/ModalList.php b/wp-content/mu-plugins/physioassist/src/Elementor/Widgets/ModalList.php index 01368b80..7fa142df 100644 --- a/wp-content/mu-plugins/physioassist/src/Elementor/Widgets/ModalList.php +++ b/wp-content/mu-plugins/physioassist/src/Elementor/Widgets/ModalList.php @@ -41,10 +41,12 @@ class ModalList extends Widget_Base { */ public function get_script_depends() { + wp_register_script('lity', \App\asset_path('scripts/lity.js'), ['jquery'], null, true); + wp_register_script( 'cube-modal-list', \App\asset_path('scripts/modal-list.js'), - ['jquery'], // Dependencies + ['jquery', 'lity'], // Dependencies null, // Version true // In footer? ); diff --git a/wp-content/mu-plugins/physioassist/src/Elementor/Widgets/ProfileGrid.php b/wp-content/mu-plugins/physioassist/src/Elementor/Widgets/ProfileGrid.php index baaa9428..38c0ce9f 100644 --- a/wp-content/mu-plugins/physioassist/src/Elementor/Widgets/ProfileGrid.php +++ b/wp-content/mu-plugins/physioassist/src/Elementor/Widgets/ProfileGrid.php @@ -41,10 +41,12 @@ class ProfileGrid extends Widget_Base { */ public function get_script_depends() { + wp_register_script('lity', \App\asset_path('scripts/lity.js'), ['jquery'], null, true); + wp_register_script( 'cube-profile-grid', \App\asset_path('scripts/profile-grid.js'), - ['jquery'], // Dependencies + ['jquery', 'lity'], // Dependencies null, // Version true // In footer? ); diff --git a/wp-content/themes/physioassist/resources/assets/config.json b/wp-content/themes/physioassist/resources/assets/config.json index b1adc13e..8a412602 100644 --- a/wp-content/themes/physioassist/resources/assets/config.json +++ b/wp-content/themes/physioassist/resources/assets/config.json @@ -25,6 +25,9 @@ "modal-list": [ "./scripts/modal-list.js" ], + "lity": [ + "./scripts/lity.js" + ], "customizer": [ "./scripts/customizer.js" ] diff --git a/wp-content/themes/physioassist/resources/assets/scripts/lity.js b/wp-content/themes/physioassist/resources/assets/scripts/lity.js new file mode 100644 index 00000000..95e8421f --- /dev/null +++ b/wp-content/themes/physioassist/resources/assets/scripts/lity.js @@ -0,0 +1,2 @@ +// Create a local copy of lity. Maybe this could be copied directly to /dist/scripts on build instead? +import lity from 'lity'; // eslint-disable-line diff --git a/wp-content/themes/physioassist/resources/assets/scripts/modal-list.js b/wp-content/themes/physioassist/resources/assets/scripts/modal-list.js index 0b8b2b86..9e3f9b48 100644 --- a/wp-content/themes/physioassist/resources/assets/scripts/modal-list.js +++ b/wp-content/themes/physioassist/resources/assets/scripts/modal-list.js @@ -1,5 +1,3 @@ -import lity from 'lity'; // eslint-disable-line - (function($) { // ELEMENTOR Trigger diff --git a/wp-content/themes/physioassist/resources/assets/scripts/profile-grid.js b/wp-content/themes/physioassist/resources/assets/scripts/profile-grid.js index 3d0e5c9b..9da559dd 100644 --- a/wp-content/themes/physioassist/resources/assets/scripts/profile-grid.js +++ b/wp-content/themes/physioassist/resources/assets/scripts/profile-grid.js @@ -1,5 +1,4 @@ import trunk8 from 'trunk8'; // eslint-disable-line -import lity from 'lity'; // eslint-disable-line import debounce from 'lodash.debounce'; var text_selector = '.profile-grid-body', -- 2.39.5