mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Allow delete single history item
This commit is contained in:
parent
657e9272f1
commit
cb06d32753
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
min/custom-navbar.min.css
vendored
2
min/custom-navbar.min.css
vendored
File diff suppressed because one or more lines are too long
2
min/custom-navbar.min.js
vendored
2
min/custom-navbar.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1161,6 +1161,7 @@ li.nav-item[report-id='playpage_dynamic'] .i-frame,
|
||||
}
|
||||
.custom-navbar em.suggest-highlight {
|
||||
color: var(--theme-color);
|
||||
font-style: normal;
|
||||
}
|
||||
.custom-navbar .search-list-item {
|
||||
padding: 6px;
|
||||
|
||||
@ -680,7 +680,7 @@ class SearchBox extends NavbarComponent {
|
||||
</button>
|
||||
</form>
|
||||
<div class="popup search-list" :class="{empty: items.length === 0}">
|
||||
<div class="search-list-item" tabindex="0" v-for="(item, index) of items" v-html="item.html" @keydown.enter="submit(item.value)" @click.self="submit(item.value)" @keydown.down.prevent="nextItem(index)" @keydown.up.prevent="previousItem(index)"></div>
|
||||
<div class="search-list-item" tabindex="0" v-for="(item, index) of items" v-html="item.html" @keydown.enter="submit(item.value)" @click.self="submit(item.value)" @keydown.shift.delete="deleteItem(item, index)" @keydown.down.prevent="nextItem(index)" @keydown.up.prevent="previousItem(index)"></div>
|
||||
<div tabindex="0" v-if="items.length > 0 && isHistory" class="search-list-item clear-history" @click="clearSearchHistory()" @keydown.enter="clearSearchHistory()" @keydown.down.prevent="nextItem(items.length)" @keydown.up.prevent="previousItem(items.length)"><i class="mdi mdi-18px mdi-delete-sweep"></i>清除搜索历史</div>
|
||||
</div>
|
||||
`;
|
||||
@ -758,6 +758,10 @@ class SearchBox extends NavbarComponent {
|
||||
return
|
||||
}
|
||||
},
|
||||
deleteItem (item, index) {
|
||||
settings.searchHistory = settings.searchHistory.splice(settings.searchHistory.findIndex(it => it.keyword === item.value), 1)
|
||||
this.items.splice(index, 1)
|
||||
},
|
||||
clearSearchHistory () {
|
||||
settings.searchHistory = []
|
||||
this.items = []
|
||||
|
||||
Loading…
Reference in New Issue
Block a user