Skip to content

Commit 4854248

Browse files
committed
Update filebrowser.js
1 parent ee49936 commit 4854248

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

filebrowser.js

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3104,19 +3104,9 @@ function setupEditor() {
31043104

31053105
// update on screen resize
31063106

3107-
let lastWidth;
3108-
3109-
window.addEventListener('resize', () => {
3110-
3111-
if (lastWidth === window.innerWidth) {
3112-
return;
3113-
}
3114-
3115-
lastWidth = window.innerWidth;
3116-
3117-
updateLineNumbersHTML();
3118-
3119-
});
3107+
const portrait = window.matchMedia('(orientation: portrait)');
3108+
3109+
portrait.addEventListener('change', updateLineNumbersHTML);
31203110

31213111

31223112
let beautifierOptions = {

0 commit comments

Comments
 (0)