Skip to content

Commit 3563b7a

Browse files
authored
Fix: Remove some conditionals to force preview mode on patterns. (#135)
1 parent 8925f90 commit 3563b7a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

assets/src/js/pro/_acf-blocks.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const md5 = require( 'md5' );
110110
* @return boolean
111111
*/
112112
function isSiteEditor() {
113-
return typeof pagenow === 'string' && pagenow === 'site-editor';
113+
return document.querySelectorAll( 'iframe[name="editor-canvas"]' ).length > 0;
114114
}
115115

116116
/**
@@ -758,9 +758,7 @@ const md5 = require( 'md5' );
758758

759759
if (
760760
isBlockInQueryLoop( clientId ) ||
761-
isSiteEditor() ||
762-
isiFramedMobileDevicePreview() ||
763-
isEditingTemplate()
761+
isSiteEditor()
764762
) {
765763
restrictMode( [ 'preview' ] );
766764
} else {
@@ -783,9 +781,7 @@ const md5 = require( 'md5' );
783781
const blockType = getBlockType( name );
784782
const forcePreview =
785783
isBlockInQueryLoop( clientId ) ||
786-
isSiteEditor() ||
787-
isiFramedMobileDevicePreview() ||
788-
isEditingTemplate();
784+
isSiteEditor();
789785
let { mode } = attributes;
790786

791787
if ( forcePreview ) {

0 commit comments

Comments
 (0)