Skip to content

Commit

Permalink
Tidy up, lint
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Dec 9, 2024
1 parent 7f641f5 commit 04c697f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
19 changes: 14 additions & 5 deletions src/main/js/components/command-palette/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,23 @@ function init() {
}

searchResultsContainer.style.height = searchResults.offsetHeight + "px";
debouncedSpinner.cancel();
commandPaletteSearchBarContainer.classList.remove(
"jenkins-search--loading",
);
});
}

const debouncedSpinner = debounce(() => {
commandPaletteSearchBarContainer.classList.add("jenkins-search--loading");
}, 150);

const debouncedLoad = debounce(() => {
renderResults();
}, 150);

commandPaletteInput.addEventListener("input", () => {
commandPaletteSearchBarContainer.classList.add("jenkins-search--loading");
debouncedSpinner();
debouncedLoad();
});

Expand All @@ -121,10 +126,14 @@ function init() {
function hideCommandPalette() {
commandPalette.setAttribute("closing", "");

commandPalette.addEventListener("animationend", () => {
commandPalette.removeAttribute("closing");
commandPalette.close();
}, {once: true});
commandPalette.addEventListener(
"animationend",
() => {
commandPalette.removeAttribute("closing");
commandPalette.close();
},
{ once: true },
);
}

function itemMouseEnter(item) {
Expand Down
8 changes: 2 additions & 6 deletions src/main/scss/components/_command-palette.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
max-width: 100vw !important;
margin: 0 !important;
padding: 0 !important;
transform-style: preserve-3d;
user-select: none;

&::backdrop {
background: var(--command-palette-backdrop-background);
Expand All @@ -35,7 +35,6 @@
translate: 0 4px;
scale: 98.5%;
opacity: 0;
filter: blur(15px);
transform: rotateX(30deg);
}
}
Expand All @@ -44,7 +43,6 @@
to {
scale: 98.5%;
opacity: 0;
filter: blur(2.5px);
}
}

Expand Down Expand Up @@ -113,7 +111,7 @@
padding: 0.5rem;

&__heading {
font-weight: 550;
font-weight: 500;
font-size: 0.875rem;
margin: 0;
padding: 0.75rem 0.75rem 0.625rem;
Expand Down Expand Up @@ -144,7 +142,6 @@
background: transparent;
padding: 0.75rem;
border-radius: 0.5rem;
font-weight: 550;
cursor: pointer;
color: var(--text-color) !important;
transition: var(--standard-transition);
Expand Down Expand Up @@ -193,7 +190,6 @@
}

&__info {
font-weight: 550;
font-size: 0.875rem;
margin: 0;
padding: 0 14px;
Expand Down
2 changes: 1 addition & 1 deletion src/main/scss/form/_search-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
place-self: center center;
opacity: 0;
scale: 0;
filter: blur(5px);
filter: blur(2.5px);
}

&::after {
Expand Down

0 comments on commit 04c697f

Please sign in to comment.