Add new command to open the search window

This commit is contained in:
Nachtalb 2021-05-06 03:22:09 +02:00
parent 26a38b12ab
commit 24a738d521
No known key found for this signature in database
GPG key ID: E48DF13C07055D92
4 changed files with 34 additions and 1 deletions

View file

@ -183,6 +183,10 @@ export default {
},
setInputSize() {
this.$nextTick(() => {
if (!this.$refs.input) {
return;
}
const style = window.getComputedStyle(this.$refs.input);
const lineHeight = parseFloat(style.lineHeight, 10) || 1;

View file

@ -673,6 +673,15 @@
</div>
</div>
<div class="help-item">
<div class="subject">
<code>/search query</code>
</div>
<div class="description">
<p>Search for messages in the current channel / user</p>
</div>
</div>
<div class="help-item">
<div class="subject">
<code>/topic [newtopic]</code>

View file

@ -0,0 +1,20 @@
"use strict";
import store from "../store";
import {router} from "../router";
function input(args) {
router.push({
name: "SearchResults",
params: {
id: store.state.activeChannel.channel.id,
},
query: {
q: args.join(" "),
},
});
return true;
}
export default {input};

View file

@ -1,4 +1,4 @@
const clientSideCommands = ["/collapse", "/expand"];
const clientSideCommands = ["/collapse", "/expand", "/search"];
const passThroughCommands = [
"/as",