Skip to content

Commit 7016270

Browse files
committed
Update live-view.js
1 parent f9a9a49 commit 7016270

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

live-view/live-view.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,31 @@ async function setupLiveView() {
5959
// if URL has a directory
6060
if (linkData.dir) {
6161

62+
// don't transition
63+
body.classList.add('notransition');
64+
65+
// if on mobile device
66+
// and URL has a file
67+
if (isMobile && linkData.file) {
68+
69+
// close sidebar
70+
toggleSidebar(false);
71+
saveSidebarStateLS();
72+
73+
} else {
74+
75+
// open sidebar
76+
toggleSidebar(true);
77+
saveSidebarStateLS();
78+
79+
}
80+
81+
// restore transition on next frame
82+
onNextFrame(() => {
83+
body.classList.remove('notransition');
84+
});
85+
86+
6287
// update repo obj selected branch
6388

6489
let selBranch = linkData.dir[1].split(':')[1];
@@ -103,31 +128,6 @@ async function setupLiveView() {
103128

104129
}
105130

106-
107-
// don't transition
108-
body.classList.add('notransition');
109-
110-
// if on mobile device
111-
// and URL has a file
112-
if (isMobile && linkData.file) {
113-
114-
// close sidebar
115-
toggleSidebar(false);
116-
saveSidebarStateLS();
117-
118-
} else {
119-
120-
// open sidebar
121-
toggleSidebar(true);
122-
saveSidebarStateLS();
123-
124-
}
125-
126-
// restore transition on next frame
127-
onNextFrame(() => {
128-
body.classList.remove('notransition');
129-
});
130-
131131
}
132132

133133
// if URL has a file

0 commit comments

Comments
 (0)