| @@ -775,9 +775,16 @@ | ||
| 775 | 775 | /** |
| 776 | 776 | * Localize This In Order To Know If This Block Is Arriving From Betterdocs Templates Or Not |
| 777 | 777 | */ |
| 778 | 778 | betterdocs()->assets->localize( 'betterdocs-el-category-grid', 'betterdocsCategoryGridConfig', [ |
| 779 | - 'is_betterdocs_templates' => betterdocs()->helper->is_templates() ? true : false | |
| 779 | + 'is_betterdocs_templates' => betterdocs()->helper->is_templates() ? true : false, | |
| 780 | + // Must also carry the lazy-load endpoint. wp_localize_script concatenates | |
| 781 | + // every `var betterdocsCategoryGridConfig = …` for this object name and the | |
| 782 | + // last assignment wins; shipping only is_betterdocs_templates here clobbered | |
| 783 | + // Scripts.php's full config on Elementor pages, leaving ajax_url undefined so | |
| 784 | + // loadLazyBody() bailed and sidebar lazy-load never fired. | |
| 785 | + 'ajax_url' => admin_url( 'admin-ajax.php' ), | |
| 786 | + 'lazy_load_action' => 'betterdocs_lazy_category_body', | |
| 780 | 787 | ] ); |
| 781 | 788 | |
| 782 | 789 | if ( betterdocs()->helper->is_el_templates() == true ) { |
| 783 | 790 | $assets->enqueue( 'betterdocs-elementor-editor', 'elementor/css/betterdocs-el-edit.css' ); |