mirror of
https://github.com/huhu/rust-search-extension
synced 2024-11-14 15:47:12 +00:00
Fix delete crates haven't update the count bug
This commit is contained in:
parent
64a6158a72
commit
b9dfffc675
2 changed files with 4 additions and 2 deletions
|
@ -195,7 +195,7 @@ function calendarHeatmap() {
|
|||
}
|
||||
|
||||
dayRects.exit().remove();
|
||||
const monthLabels = svg.selectAll('.month')
|
||||
svg.selectAll('.month')
|
||||
.data(monthRange)
|
||||
.enter().append('text')
|
||||
.attr('class', 'month-name')
|
||||
|
|
|
@ -4,6 +4,8 @@ function buildRemoveButton(name) {
|
|||
btn.textContent = "Remove";
|
||||
btn.onclick = () => {
|
||||
CrateDocManager.removeCrate(name);
|
||||
// Update the crate count
|
||||
document.getElementById("crate-count").textContent = Object.keys(CrateDocManager.getCrates()).length || 0;
|
||||
btn.parentElement.remove();
|
||||
};
|
||||
return btn;
|
||||
|
@ -64,7 +66,7 @@ function refresh(orderBy = "time") {
|
|||
}
|
||||
|
||||
let crateFilter = document.querySelector("select[name='crate-filter']");
|
||||
crateFilter.onchange = function() {
|
||||
crateFilter.onchange = function () {
|
||||
refresh(crateFilter.value);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue