Skip to content
Open
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
23 changes: 23 additions & 0 deletions pages/vomnibar_page.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ ul {
z-index: 2139999999;
}

#vomnibar #vomnibar-search-input-wrapper {
position: relative;
display: flex;
align-items: center;
}

#vomnibar input {
font-size: 20px;
height: 34px;
Expand All @@ -37,6 +43,17 @@ ul {
box-sizing: border-box;
}

#vomnibar #new-tab-indicator {
position: absolute;
margin: 4px;
padding: 0 4px;
background-color: #f1f1f1;
color: #888;
border: 1px solid #e8e8e8;
border-radius: 3px;
right: 0;
}

#vomnibar-search-area {
display: block;
padding: 10px;
Expand Down Expand Up @@ -155,6 +172,12 @@ ul {
border: none;
}

#vomnibar #new-tab-indicator {
background-color: var(--vimium-background-color);
color: #aaa;
border: 1px solid var(--vimium-foreground-color);
}

/* Ensure selected text is visible in dark mode. */
#vomnibar input::selection {
color: var(--vimium-foreground-color);
Expand Down
5 changes: 4 additions & 1 deletion pages/vomnibar_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
<body>
<div id="vomnibar">
<div id="vomnibar-search-area">
<input type="text" autocomplete="off">
<div id="vomnibar-search-input-wrapper">
<input type="text" autocomplete="off">
<div id="new-tab-indicator">New tab</div>
</div>
</div>
<ul></ul>
</div>
Expand Down
5 changes: 5 additions & 0 deletions pages/vomnibar_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class VomnibarUI {
}
setForceNewTab(forceNewTab) {
this.forceNewTab = forceNewTab;
this.newTabIndicator.hidden = !forceNewTab;
}

// name: one of [omni, bookmarks, commands, tabs].
Expand Down Expand Up @@ -107,6 +108,9 @@ class VomnibarUI {
// This ensures that the vomnibar is actually hidden before any new tab is created, and avoids
// flicker after opening a link in a new tab then returning to the original tab. See #1485.
hide(onHiddenCallback = null) {
// Always hide the new tab indicator to avoid flickering (shown->hidden).
// Prefer hidden->shown transition.
this.newTabIndicator.hidden = true;
this.onHiddenCallback = onHiddenCallback;
this.input.blur();
this.reset();
Expand Down Expand Up @@ -463,6 +467,7 @@ class VomnibarUI {
this.input.addEventListener("input", this.onInput);
this.input.addEventListener("keydown", this.onKeyEvent);
this.input.addEventListener("keypress", this.onKeyEvent);
this.newTabIndicator = document.getElementById("new-tab-indicator");
this.completionList = this.box.querySelector("ul");
this.completionList.style.display = "";

Expand Down