summaryrefslogtreecommitdiffstats
path: root/src/App.vue
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-11-27 10:24:16 +0100
committerJulius Härtl <jus@bitgrid.net>2018-11-28 21:24:32 +0100
commit2912a2ecdca188aebda6dc947b0cc58f1f2912c4 (patch)
tree46ef4ea280311dd21eed639c7c7e490743c25e24 /src/App.vue
parentaf0436b9468218940860d82fdee8f5ee04cc3c22 (diff)
Add search component
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'src/App.vue')
-rw-r--r--src/App.vue18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/App.vue b/src/App.vue
index a05ed52b..b217260c 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -4,7 +4,8 @@
<app-navigation :menu="menu" />
</div>
<div id="app-content">
- <router-view :key="$route.fullPath" />
+ <Search v-if="searchTerm != ''" :term="searchTerm" />
+ <router-view v-if="searchTerm === ''" :key="$route.fullPath" />
</div>
</div>
<div v-else class="setup">
@@ -55,6 +56,7 @@ import {
import axios from 'nextcloud-axios'
import TimelineEntry from './components/TimelineEntry'
import ProfileInfo from './components/ProfileInfo'
+import Search from './components/Search'
export default {
name: 'App',
@@ -64,13 +66,15 @@ export default {
TimelineEntry,
Multiselect,
Avatar,
- ProfileInfo
+ ProfileInfo,
+ Search
},
data: function() {
return {
infoHidden: false,
state: [],
- cloudAddress: ''
+ cloudAddress: '',
+ searchTerm: ''
}
},
computed: {
@@ -157,6 +161,8 @@ export default {
if (serverDataElmt !== null) {
this.$store.commit('setServerData', JSON.parse(document.getElementById('serverData').dataset.server))
}
+
+ this.search = new OCA.Search(this.search, this.resetSearch)
},
methods: {
hideInfo() {
@@ -167,6 +173,12 @@ export default {
this.$store.commit('setServerDataEntry', 'setup', false)
this.$store.commit('setServerDataEntry', 'cloudAddress', this.cloudAddress)
})
+ },
+ search(term) {
+ this.searchTerm = term
+ },
+ resetSearch() {
+ this.searchTerm = ''
}
}
}