diff --git a/libs/features/personalization/preview.js b/libs/features/personalization/preview.js index 28caab1d2d..df2d7944fc 100644 --- a/libs/features/personalization/preview.js +++ b/libs/features/personalization/preview.js @@ -213,51 +213,59 @@ function createPreviewPill(manifests) { document.body.dataset.mepHighlight = true; } + const PREVIEW_BUTTON_ID = 'preview-button'; + div.innerHTML = `
${manifests?.length || 0} Manifest(s) served
-
-
-

${manifests?.length || 0} Manifest(s) served

- -
Page Info:
-
Target integration feature is ${targetOnText}
-
Personalization feature is ${personalizationOnText}
-
Page's Locale is ${config.locale.ietf}
-
-
-
-
-
- +
+
+

${manifests?.length || 0} Manifest(s) served

+ +
Page Info:
+
Target integration feature is ${targetOnText}
+
Personalization feature is ${personalizationOnText}
+
Page's Locale is ${config.locale.ietf}
- ${manifestList} -
-
Advanced options
-
-
- Optional: new manifest location or path -
+
+
+ +
+
+ ${manifestList} +
+
Advanced options
+
- + Optional: new manifest location or path +
+
+
+ +
-
-
-
- +
+
+ +
-
-
- Preview +
+ Preview +
`; + + const previewButton = div.querySelector(`a[data-id="${PREVIEW_BUTTON_ID}"]`); + + if (previewButton) previewButton.href = simulateHref.href; + overlay.append(div); addPillEventListeners(div); }