ui: add keyboard shortcuts
This commit is contained in:
@@ -92,6 +92,7 @@ const exportBoardEl = ref(null)
|
||||
const groupListEl = ref(null)
|
||||
const sidebarEl = ref(null)
|
||||
const poolEl = ref(null)
|
||||
const poolSearchEl = ref(null)
|
||||
const groupDropEls = ref({})
|
||||
const fileEl = ref(null)
|
||||
const thumbnailFileEl = ref(null)
|
||||
@@ -386,6 +387,11 @@ function scheduleEditorSidebarMeasure() {
|
||||
})
|
||||
}
|
||||
|
||||
function focusPoolSearch() {
|
||||
poolSearchEl.value?.focus()
|
||||
poolSearchEl.value?.select()
|
||||
}
|
||||
|
||||
function openItemContextMenu(itemId, event) {
|
||||
if (!canEdit.value || !itemId || !itemsById.value[itemId] || shouldIgnoreItemClick()) return
|
||||
selectedItemId.value = itemId
|
||||
@@ -1399,6 +1405,7 @@ onMounted(() => {
|
||||
window.addEventListener('scroll', closeItemContextMenu, true)
|
||||
window.addEventListener('resize', scheduleEditorSidebarMeasure)
|
||||
window.addEventListener('scroll', scheduleEditorSidebarMeasure, true)
|
||||
window.addEventListener('tier-maker:focus-editor-item-search', focusPoolSearch)
|
||||
nextTick(() => scheduleEditorSidebarMeasure())
|
||||
})
|
||||
|
||||
@@ -1410,6 +1417,7 @@ onUnmounted(() => {
|
||||
window.removeEventListener('scroll', closeItemContextMenu, true)
|
||||
window.removeEventListener('resize', scheduleEditorSidebarMeasure)
|
||||
window.removeEventListener('scroll', scheduleEditorSidebarMeasure, true)
|
||||
window.removeEventListener('tier-maker:focus-editor-item-search', focusPoolSearch)
|
||||
if (editorSidebarMeasureFrame) {
|
||||
window.cancelAnimationFrame(editorSidebarMeasureFrame)
|
||||
editorSidebarMeasureFrame = 0
|
||||
@@ -1810,6 +1818,7 @@ onUnmounted(() => {
|
||||
{{ canEdit ? '아이템을 드래그하거나, 클릭으로 선택한 뒤 원하는 셀/풀을 클릭해서 옮길 수 있어요.' : '공개 티어표는 보기 전용입니다.' }}
|
||||
</div>
|
||||
<input
|
||||
ref="poolSearchEl"
|
||||
v-model="poolSearchQuery"
|
||||
class="sidebar__search"
|
||||
type="text"
|
||||
|
||||
Reference in New Issue
Block a user