File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
1010} from "../../types/types" ;
1111import livePreviewPostMessage from "../eventManager/livePreviewEventManager" ;
1212import { EDIT_BUTTON_TOOLTIP_ID } from "./editButton.constant" ;
13+ import { isOpeningInTimeline } from "../../utils" ;
1314
1415function calculateEditButtonPosition (
1516 currentHoveredElement : HTMLElement ,
@@ -542,7 +543,7 @@ effect(function handleWindowTypeChange() {
542543 // here, we run it when the value of windowType changes
543544 if ( typeof window === "undefined" ) return ;
544545 Config . get ( ) . windowType ;
545- if ( LivePreviewEditButton ) {
546+ if ( LivePreviewEditButton && ! isOpeningInTimeline ( ) ) {
546547 toggleEditButtonElement ( ) ;
547548 }
548549} ) ;
Original file line number Diff line number Diff line change 11import Config from "../configManager/configManager" ;
22import { PublicLogger } from "../logger/logger" ;
33import { ILivePreviewModeConfig } from "../types/types" ;
4- import { addLivePreviewQueryTags } from "../utils" ;
4+ import { addLivePreviewQueryTags , isOpeningInTimeline } from "../utils" ;
55import { LivePreviewEditButton } from "./editButton/editButton" ;
66import { sendInitializeLivePreviewPostMessageEvent } from "./eventManager/postMessageEvent.hooks" ;
77import { removeDataCslp } from "./livePreviewProductionCleanup" ;
@@ -53,8 +53,9 @@ export default class LivePreview {
5353 // render the hover outline only when edit button enable
5454
5555 if (
56- config . editButton . enable ||
57- config . mode >= ILivePreviewModeConfig . BUILDER
56+ ! isOpeningInTimeline ( ) &&
57+ ( config . editButton . enable ||
58+ config . mode >= ILivePreviewModeConfig . BUILDER )
5859 ) {
5960 LivePreviewEditButton . livePreviewEditButton =
6061 new LivePreviewEditButton ( ) ;
Original file line number Diff line number Diff line change @@ -38,4 +38,12 @@ export function addParamsToUrl() {
3838 event . target . href = newUrl || target . href ;
3939 }
4040 } ) ;
41+ }
42+ export function isOpeningInTimeline ( ) : boolean {
43+ if ( hasWindow ( ) ) {
44+ const urlParams = new URLSearchParams ( window . location . search ) ;
45+ const previewTimestamp = urlParams . get ( "preview_timestamp" ) ;
46+ return ! ! previewTimestamp ;
47+ }
48+ return false ;
4149}
You can’t perform that action at this time.
0 commit comments