From ac034634ee238123596250b8492f2e4f584f2b34 Mon Sep 17 00:00:00 2001 From: Brian Hogg Date: Fri, 13 Sep 2024 10:49:32 -0400 Subject: [PATCH] Add a div to the header toolbar vs. just a button on its own. Doesn't fix the issue with Kadence Builder yet though. --- src/js/sidebar/course-builder/toolbar-launch-button.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/js/sidebar/course-builder/toolbar-launch-button.jsx b/src/js/sidebar/course-builder/toolbar-launch-button.jsx index 5ad8d81..261f2ec 100644 --- a/src/js/sidebar/course-builder/toolbar-launch-button.jsx +++ b/src/js/sidebar/course-builder/toolbar-launch-button.jsx @@ -25,7 +25,7 @@ export const addToolbarLaunchButton = () => { if ( ! editPostHeaderToolbarLeft ) { // Post WP 6.5 area editPostHeaderToolbarLeft = document.getElementsByClassName( - 'editor-document-tools__left' + 'edit-post-header-toolbar' )[ 0 ]; } @@ -42,6 +42,8 @@ export const addToolbarLaunchButton = () => { return; } + const buttonDiv = document.createElement( 'div' ); + const button = document.createElement( 'a' ); button.id = buttonId; @@ -50,7 +52,9 @@ export const addToolbarLaunchButton = () => { button.style.marginLeft = '16px'; button.innerHTML = __( 'Launch Course Builder', 'lifterlms' ); - editPostHeaderToolbarLeft.appendChild( button ); + buttonDiv.appendChild( button ); + + editPostHeaderToolbarLeft.appendChild( buttonDiv ); }, 1 ); };