Skip to content

Commit 2e5ee7c

Browse files
committed
fix: small visible white space at side of overlay
1 parent edcddb0 commit 2e5ee7c

File tree

2 files changed

+2
-32
lines changed

2 files changed

+2
-32
lines changed

src/extensionsIntegrated/Phoenix-live-preview/live-preview.css

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,11 @@
158158
}
159159

160160
.live-preview-status-overlay {
161-
width: calc(100% - 3px);
161+
width: 100%;
162162
position: absolute;
163163
top: 30px;
164-
left: 3px;
165-
z-index: 100;
166-
}
167-
168-
.live-preview-status-overlay.full-width {
169-
width: 100%;
170164
left: 0;
165+
z-index: 100;
171166
}
172167

173168
.live-preview-overlay-message {

src/extensionsIntegrated/Phoenix-live-preview/main.js

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -288,27 +288,6 @@ define(function (require, exports, module) {
288288
}
289289
}
290290

291-
/**
292-
* this function adds/remove the full-width class from the overlay container
293-
* styled inside 'live-preview.css'
294-
*
295-
* we need this because
296-
* normally when live preview has a good width (more than 305px) then a 3px divider is shown at the left end
297-
* so in that case we give the overlay a width of (100% - 3px),
298-
* but when the live preview width is reduced
299-
* then that divider line gets cut off, so in that case we make the width 100% for this overlay
300-
*
301-
* without this handling, a white gap appears on the left side, which is distracting
302-
*/
303-
function _setOverlayWidth() {
304-
if(!$overlayContainer || !$panel || !$panel.length) { return; }
305-
if($panel.width() <= 305) {
306-
$overlayContainer.addClass("full-width");
307-
} else {
308-
$overlayContainer.removeClass("full-width");
309-
}
310-
}
311-
312291
/**
313292
* update the mode button text in the live preview toolbar UI based on the current mode
314293
* @param {String} mode - The current mode ("preview", "highlight", or "edit")
@@ -806,10 +785,6 @@ define(function (require, exports, module) {
806785
_loadPreview(true, true);
807786
Metrics.countEvent(Metrics.EVENT_TYPE.LIVE_PREVIEW, "reloadBtn", "click");
808787
});
809-
810-
// Set up ResizeObserver for overlay width adjustments
811-
// to understand why we're doing this read _setOverlayWidth function
812-
new ResizeObserver(_setOverlayWidth).observe($panel[0]);
813788
}
814789

815790
async function _loadPreview(force, isReload) {

0 commit comments

Comments
 (0)