6363 this . gutenbergContainer . find ( '.edit-post-header-toolbar' ) . children ( ) . hide ( ) ;
6464 this . elements . $useWpEditorBtn . show ( ) ;
6565 this . elements . $useBuilderBtn . hide ( ) ;
66- this . gutenbergContainer . find ( '.editor-block-list__layout' ) . hide ( ) ;
66+ this . gutenbergContainer . find ( ".block-editor-block-list__layout" ) . hide ( ) ;
67+ this . gutenbergContainer . find ( ".block-editor-writing-flow__click-redirect" ) . hide ( ) ;
6768 }
6869
6970 // set the hidden to store that the builder is active
7273 this . events . trigger ( 'show' ) ;
7374 } ,
7475 hideBuilder : function ( ) {
76+
77+ if ( this . isGutenberg ( ) ) {
78+
79+ if ( $ ( '#editor' ) . hasClass ( 'page-builder-visible' ) ) {
80+ this . gutenbergContainer . find ( ".block-editor-block-list__layout" ) . show ( ) ;
81+ this . gutenbergContainer . find ( ".block-editor-writing-flow__click-redirect" ) . show ( ) ;
82+ }
83+
84+ this . gutenbergContainer . find ( '.edit-post-header-toolbar' ) . children ( ) . show ( ) ;
85+ this . elements . $useWpEditorBtn . hide ( ) ;
86+ this . elements . $useBuilderBtn . show ( ) ;
87+ }
88+
7589 this . elements . $wpPostBodyContent . removeClass ( 'page-builder-visible' ) ;
7690 this . elements . $useWpEditorBtn . hide ( ) ;
7791 this . elements . $builderBox . hide ( ) ;
8195 this . elements . $builderActiveHidden . val ( 'false' ) ;
8296 //tinyMCE.get( gui.editorId ).execCommand("mceRepaint");
8397
84- if ( this . isGutenberg ( ) ) {
85- this . gutenbergContainer . find ( '.edit-post-header-toolbar' ) . children ( ) . show ( ) ;
86- this . elements . $useWpEditorBtn . hide ( ) ;
87- this . elements . $useBuilderBtn . show ( ) ;
88- this . gutenbergContainer . find ( '.editor-block-list__layout' ) . show ( ) ;
89- }
90-
9198 this . events . trigger ( 'hide' ) ;
9299 } ,
93100 initButtons : function ( ) {
@@ -399,4 +406,4 @@ jQuery( function ( $ ) {
399406
400407 originalContentValue = '' ; // free memory
401408 } ) ;
402- } ) ;
409+ } ) ;
0 commit comments