Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite9ed8e8

Browse files
authored
added autofocus for helphub (#991)
1 parente7d25d7 commite9ed8e8

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

‎_includes/docs-navbar.html‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@
9898

9999
{% if page.layout != "home" %}
100100
<button
101-
onclick="window.CommandBar.toggleHelpHub()"
101+
onclick="window.CommandBar.openHelpHub(); setTimeout(() => {
102+
document.querySelector('input[data-testid=helphub-input]').focus()
103+
}, 100)"
102104
class="helpbub-toggler helpbub-toggler--small order-2 order-md-2"
103105
aria-label="Search Codefresh Documentation"
104106
type="button"

‎_includes/scripts.html‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@
6161

6262
document.addEventListener("keydown",function(event){
6363
if(event.metaKey&&event.key==="k"){
64-
window.CommandBar.toggleHelpHub();
64+
window.CommandBar.openHelpHub();
65+
setTimeout(()=>{
66+
document.querySelector('input[data-testid=helphub-input]').focus()
67+
},100);
6568
}
6669
});
6770
</script>

‎index.html‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ <h2 class="mb-3 bd-text-white text-uppercase">
2121
</p>
2222
<!-- <div id="searchbar"></div>-->
2323
<button
24-
onclick="window.CommandBar.toggleHelpHub()"
24+
onclick="window.CommandBar.openHelpHub(); setTimeout(() => {
25+
document.querySelector('input[data-testid=helphub-input]').focus()
26+
}, 100)"
2527
class="helpbub-toggler mb-3"
2628
aria-label="Search Codefresh Documentation"
2729
type="button"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp