Skip to content

Commit a4fa66d

Browse files
committed
feat: search button not working
1 parent 5c92537 commit a4fa66d

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

src/styles/CentralControlBar.less

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
display: flex;
3131
flex-direction: column;
3232
align-items: stretch;
33-
gap: 2px;
34-
padding: 4px 0;
33+
gap: 8px;
34+
padding: 8px 0;
3535
box-sizing: border-box;
3636
user-select: none;
37-
background-color: @main-toolbar-background-color;
37+
background-color: #252525;
3838
border-right: 1px solid rgba(0, 0, 0, 0.45);
3939

4040
.ccb-btn {

src/view/SidebarTabs.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ define(function (require, exports, module) {
172172
if (!$controlBar) {
173173
return;
174174
}
175+
176+
// Detach the search button (if it exists) so NavigationProvider's
177+
// cached reference and click handler survive rebuilds.
178+
const $searchNav = $controlBar.find("#searchNav").detach();
179+
175180
$controlBar.empty();
176181
_tabs.sort(function (a, b) { return a.priority - b.priority; });
177182

@@ -188,9 +193,13 @@ define(function (require, exports, module) {
188193
$controlBar.append($item);
189194
});
190195

191-
// Render the search button
192-
$controlBar.append('<a href="#" id="searchNav" class="ccb-btn" title="' +
193-
Strings.CMD_FIND_IN_FILES + '">' + ICON_SEARCH + '</a>');
196+
// Re-attach or create the search button
197+
if ($searchNav.length) {
198+
$controlBar.append($searchNav);
199+
} else {
200+
$controlBar.append('<a href="#" id="searchNav" class="ccb-btn" title="' +
201+
Strings.CMD_FIND_IN_FILES + '">' + ICON_SEARCH + '</a>');
202+
}
194203

195204
// Also rebuild the sidebar chip bar
196205
if ($navTabBar) {

0 commit comments

Comments
 (0)