diff options
| author | Shpuld Shpludson <shp@cock.li> | 2019-07-15 16:42:27 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2019-07-15 16:42:27 +0000 |
| commit | e9b452575b9a5ef87808898086771ae806fc3a8b (patch) | |
| tree | bcae50c611c8667da46a18a91c94b15ad891221d /src/components/search_bar/search_bar.js | |
| parent | 0c064105841608c93649992eeb609e63b73ad595 (diff) | |
| parent | 69a4bcb238b347a139bfb1192413b45c8b9d7e36 (diff) | |
Merge branch 'new-search' into 'develop'
New search
See merge request pleroma/pleroma-fe!832
Diffstat (limited to 'src/components/search_bar/search_bar.js')
| -rw-r--r-- | src/components/search_bar/search_bar.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/components/search_bar/search_bar.js b/src/components/search_bar/search_bar.js new file mode 100644 index 00000000..b8a792ee --- /dev/null +++ b/src/components/search_bar/search_bar.js @@ -0,0 +1,27 @@ +const SearchBar = { + data: () => ({ + searchTerm: undefined, + hidden: true, + error: false, + loading: false + }), + watch: { + '$route': function (route) { + if (route.name === 'search') { + this.searchTerm = route.query.query + } + } + }, + methods: { + find (searchTerm) { + this.$router.push({ name: 'search', query: { query: searchTerm } }) + this.$refs.searchInput.focus() + }, + toggleHidden () { + this.hidden = !this.hidden + this.$emit('toggled', this.hidden) + } + } +} + +export default SearchBar |
