hardlounge/client/components/ChatInput.vue

44 lines
798 B
Vue
Raw Normal View History

2018-07-08 13:42:54 +00:00
<template>
<form
id="form"
method="post"
action="">
<span id="nick">{{ network.nick }}</span>
<textarea
id="input"
v-model="channel.pendingMessage"
:placeholder="getInputPlaceholder(channel)"
:aria-label="getInputPlaceholder(channel)"
class="mousetrap"
/>
<span
id="submit-tooltip"
class="tooltipped tooltipped-w tooltipped-no-touch"
aria-label="Send message">
<button
id="submit"
type="submit"
aria-label="Send message"/>
</span>
</form>
</template>
<script>
export default {
name: "ChatInput",
props: {
network: Object,
channel: Object,
},
methods: {
getInputPlaceholder(channel) {
if (channel.type === "channel" || channel.type === "query") {
return `Write to ${channel.name}`;
}
return "";
},
},
};
</script>