Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@
</div>
</div>
</dialog>
<script type="module" src="/js/dashboard.js?v=7844649a"></script>
<script type="module" src="/js/dashboard.js?v=0014229e"></script>
</body></html>
2 changes: 1 addition & 1 deletion ui/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
titleWhenTruncated,
} from '/js/utils.js?v=ed0f1802';
import { initFluidHover } from '/js/fluid-hover.js?v=cb886e86';
import { initSpotlight } from '/js/spotlight.js?v=6cac6066';
import { initSpotlight } from '/js/spotlight.js?v=2d911c06';
import { html, setHtml, raw } from '/js/html.js?v=c71f8903';
import { initI18n, t, currentLang } from '/js/i18n.js?v=1f1ea9c1';
import { pwStrength, passwordMismatch } from '/js/password-strength.js?v=42f45ac7';
Expand Down
9 changes: 5 additions & 4 deletions ui/js/spotlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ export function initSpotlight({ getItems, isMob, CB, iconChain, openFolderDeskto
a.setAttribute('aria-selected', i === 0 ? 'true' : 'false');
a.style.cssText =
'display:flex;align-items:center;gap:18px;padding:14px 20px;text-decoration:none;cursor:pointer;-webkit-tap-highlight-color:transparent;';
const doOpen = () => {
/* A click also follows the link. Opening here as well opens two tabs. */
const doOpen = viaTouch => {
close();
if (isFolder) {
if (MOB()) {
Expand All @@ -74,15 +75,15 @@ export function initSpotlight({ getItems, isMob, CB, iconChain, openFolderDeskto
} else openFolderDesktop(app);
} else if (app.system === 'settings' && app.href) {
window.location.href = app.href;
} else if (app.href) {
} else if (viaTouch && app.href) {
window.open(app.href, '_blank', 'noreferrer,noopener');
}
};
a.addEventListener('touchend', e => {
e.preventDefault();
doOpen();
doOpen(true);
});
a.onclick = doOpen;
a.onclick = () => doOpen(false);

const ic = mk('div');
ic.className = 'sri';
Expand Down
7 changes: 7 additions & 0 deletions ui/test/spotlight-dismiss.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,10 @@ test('the browser is asked to resize the page for the keyboard', () => {
test('the list drops the status-bar inset once the keyboard has moved it', () => {
assert.match(css, /body\.is-mob #spot\.kb #sres \{[^}]*padding-top:12px/);
});

test('a click on a result leaves the new tab to the link', () => {
assert.match(js, /target: isInternal \? '_self' : '_blank'/);
assert.match(js, /\} else if \(viaTouch && app\.href\) \{\s*window\.open\(/);
assert.match(js, /a\.onclick = \(\) => doOpen\(false\);/);
assert.match(js, /e\.preventDefault\(\);\s*doOpen\(true\);/);
});
Loading