Skip to content

Commit 6775bd1

Browse files
committed
Update filebrowser.js
1 parent 0ef2597 commit 6775bd1

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

filebrowser.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ async function renderSidebarHTML() {
111111
// if sidebar title is empty
112112
if (sidebarLogo.innerText === '') {
113113

114+
sidebarLogo.classList.add('notransition');
115+
116+
window.setTimeout(() => {
117+
sidebarLogo.classList.remove('notransition');
118+
}, 180);
119+
120+
114121
if (contents != '') {
115122

116123
// if repo is owned by logged user
@@ -125,6 +132,12 @@ async function renderSidebarHTML() {
125132
sidebarLogo.innerText = user + '/' + repoName + contents;
126133

127134
}
135+
136+
137+
// scroll to end of title
138+
sidebarLogo.scrollTo({
139+
left: sidebarLogo.scrollWidth - sidebarLogo.offsetLeft
140+
});
128141

129142
} else if (repo != '') {
130143

@@ -140,11 +153,21 @@ async function renderSidebarHTML() {
140153
sidebarLogo.innerText = user + '/' + repoName;
141154

142155
}
156+
157+
158+
// scroll to start of title
159+
sidebarLogo.scrollTo(0, 0);
160+
scrolledSidebarTitle();
143161

144162
} else {
145163

146164
// show title
147165
sidebarLogo.innerText = 'Repositories';
166+
167+
168+
// scroll to start of title
169+
sidebarLogo.scrollTo(0, 0);
170+
scrolledSidebarTitle();
148171

149172
}
150173

0 commit comments

Comments
 (0)