Run /topic when clicking on topic

This commit is contained in:
Pavel Djundik 2020-09-30 18:10:30 +03:00
parent 6ca3bae73e
commit e153f58d85
2 changed files with 9 additions and 4 deletions

View file

@ -33,7 +33,7 @@
<span type="button" aria-label="Save topic"></span>
</span>
</div>
<span v-else :title="channel.topic" class="topic" @dblclick="editTopic"
<span v-else :title="channel.topic" class="topic" @click.self="showTopic"
><ParsedMessage
v-if="channel.topic"
:network="network"
@ -183,10 +183,14 @@ export default {
hideUserVisibleError() {
this.$store.commit("currentUserVisibleError", null);
},
editTopic() {
if (this.channel.type === "channel") {
this.channel.editTopic = true;
showTopic() {
if (this.channel.type !== "channel" || !this.channel.topic) {
return;
}
const target = this.channel.id;
const text = `/raw TOPIC ${this.channel.name}`;
socket.emit("input", {target, text});
},
saveTopic() {
this.channel.editTopic = false;

View file

@ -1045,6 +1045,7 @@ textarea.input {
flex-grow: 1;
overflow: hidden;
font-size: 14px;
cursor: pointer;
}
.header .topic-input {