Browse Source
Merge pull request #1071 from doccano/fix/#1052
Show only available shortcut keys
pull/1075/head
Hiroki Nakayama
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
1 deletions
-
frontend/components/containers/labels/LabelList.vue
|
|
@ -47,7 +47,7 @@ |
|
|
|
<template v-slot:input> |
|
|
|
<v-select |
|
|
|
:value="item.suffix_key" |
|
|
|
:items="shortkeys" |
|
|
|
:items="availableShortkeys(item.suffix_key)" |
|
|
|
:label="$t('annotation.key')" |
|
|
|
@change="handleUpdateLabel({ id: item.id, suffix_key: $event })" |
|
|
|
/> |
|
|
@ -133,6 +133,12 @@ export default { |
|
|
|
this.updateLabel(data) |
|
|
|
}, |
|
|
|
|
|
|
|
availableShortkeys(suffixKey) { |
|
|
|
const usedKeys = this.items.map(item => item.suffix_key) |
|
|
|
const unusedKeys = this.shortkeys.filter(item => item === suffixKey || !usedKeys.includes(item)) |
|
|
|
return unusedKeys |
|
|
|
}, |
|
|
|
|
|
|
|
textColor(backgroundColor) { |
|
|
|
return idealColor(backgroundColor) |
|
|
|
} |
|
|
|