tab completion
This commit is contained in:
parent
14534997e8
commit
a6029cdb0d
@ -21,7 +21,8 @@
|
||||
@click="fillCmd(msg.cmd)">{{msg.cmd}} <i class="std-text" style="font-size:8pt;">{{msg.help}}</i></p>
|
||||
</div>
|
||||
<form @submit="sendChatMessage" id="msg-form">
|
||||
<input id="my-msg" autocomplete="off" v-model="text" style="flex-grow:2;"/>
|
||||
<input id="my-msg" autocomplete="off" v-model="text" style="flex-grow:2;"
|
||||
@keydown.tab.prevent="tabComplete($event.target.value)"/>
|
||||
<input id="submit-message" type="submit" class="btn" :value="$t('submit')"/>
|
||||
</form>
|
||||
</div>
|
||||
@ -164,6 +165,12 @@ export default {
|
||||
this.text = cmd;
|
||||
document.getElementById('my-msg').focus();
|
||||
},
|
||||
tabComplete() {
|
||||
if (this.commandSuggestion.length > 0) {
|
||||
let cmd = this.commandSuggestion[0].cmd;
|
||||
this.text = cmd + ' ';
|
||||
}
|
||||
},
|
||||
playEffects(path) {
|
||||
const promise = (new Audio(path)).play();
|
||||
if(promise !== undefined){
|
||||
|
Loading…
Reference in New Issue
Block a user