Skip to content

Commit 61c3fed

Browse files
authored
Merge pull request #158 from codeitcodes/dev
Dev
2 parents 4e72aa3 + 81ce230 commit 61c3fed

File tree

6 files changed

+17
-6
lines changed

6 files changed

+17
-6
lines changed

filebrowser.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2744,7 +2744,8 @@ function setupSidebar() {
27442744
renderSidebarHTML();
27452745

27462746
// if sidebar is open
2747-
if (getStorage('sidebar') == 'true') {
2747+
if (getStorage('sidebar') == 'true'
2748+
&& !isEmbed) {
27482749

27492750
// don't transition
27502751
body.classList.add('notransition');

full.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,8 @@ body.scroll-enabled .bookmark {
575575
left: -1px;
576576
}
577577

578-
.live-toggle.file-open + .sidebar-toggle {
578+
.live-toggle.file-open + .sidebar-toggle,
579+
body.embed .sidebar-toggle {
579580
display: none;
580581
}
581582

live-view/live-view.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ async function setupLiveView() {
6464

6565
// if on mobile device
6666
// and URL has a file
67-
if (isMobile && linkData.file) {
67+
if ((isMobile && linkData.file)
68+
|| isEmbed) {
6869

6970
// close sidebar
7071
toggleSidebar(false);
@@ -1007,6 +1008,8 @@ async function renderLiveViewHTML(file) {
10071008
await workerInstallPromise;
10081009

10091010
}
1011+
1012+
if (!workerClientId) await workerInstallPromise;
10101013

10111014

10121015
liveView.innerHTML = '<iframe src="'+ livePath +'?'+ workerClientId +'/" name="Live view" title="Live view" class="live-frame" allow="accelerometer; camera; encrypted-media; display-capture; geolocation; gyroscope; microphone; midi; clipboard-read; clipboard-write" allowfullscreen="true" allowpaymentrequest="true" loading="lazy" sandbox="allow-downloads allow-forms allow-modals allow-pointer-lock allow-popups allow-presentation allow-same-origin allow-scripts allow-top-navigation-by-user-activation" scrolling="yes" frameborder="0"></iframe>';

utils.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,12 @@ if (isMac) {
193193

194194
}
195195

196+
if (isEmbed) {
197+
198+
body.classList.add('embed');
199+
200+
}
201+
196202
window.addEventListener('resize', () => {
197203

198204
isLandscape = window.matchMedia('(orientation: landscape)').matches;

worker/client-channel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ function handleFetchRequest(request, event) {
197197

198198
} else if (pathType === 'run'
199199
|| (getPathType(request.referrer) === 'run')) { // if fetch originated in live view
200-
200+
201201
if (enableDevLogs) {
202202
console.debug('[ServiceWorker] Intercepted live fetch', event);
203203
}

worker/worker-channel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ async function setupWorkerChannel() {
5959
workerInstallPromise = pingWorkerForClientId();
6060

6161
workerClientId = await workerInstallPromise;
62-
62+
6363
workerInstallPromise = null;
64-
64+
6565

6666
// create worker channel
6767
workerChannel = new BroadcastChannel('worker-channel');

0 commit comments

Comments
 (0)