From de342265b1d58ca76b87d1cdee47aee814f35e7f Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Mon, 4 Dec 2023 10:53:33 -0500 Subject: [PATCH] Automatically enter folders when file-scrolling --- file-scroll.js | 8 ++++++-- manifest.json | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/file-scroll.js b/file-scroll.js index 23fbd5e..66e6350 100644 --- a/file-scroll.js +++ b/file-scroll.js @@ -12,7 +12,7 @@ const addScrollHints = () => { if (fileElement.classList.contains('file-viewed')) { hint.classList.add('sages-extra-breadcrumbs-viewed') } - hint.innerText = `${prefix} ${decodeURIComponent(fileElement.firstElementChild?.href?.split('#')[1] || 'Folder')}` + hint.innerText = `${prefix} ${decodeURIComponent(fileElement.firstElementChild?.href?.split('#')[1] || 'In Folder...')}` if (top) { hint.style.top = top } @@ -32,7 +32,7 @@ const addScrollHints = () => { } -const changeFile = e => { +const changeFile = (e, noRecurse) => { const selectedFile = getSelectedFile() const fileElements = getFileElements() @@ -42,9 +42,13 @@ const changeFile = e => { (up && index > 0) ? fileElements[index - 1] : (!up && index < (fileElements.length - 1)) ? fileElements[index + 1] : null + const isFolder = !nextElement?.firstElementChild const toClick = nextElement?.firstElementChild ?? nextElement toClick?.focus() toClick?.click() + if (isFolder) { + changeFile(e) + } } let styled = false diff --git a/manifest.json b/manifest.json index ed4b6da..5f9b297 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "Sage's BitBucket Addon", "description": "Ensure searches don't include forks (and other enhancements)", - "version": "1.0.11", + "version": "1.0.12", "manifest_version": 2, "browser_specific_settings": { "gecko": {