diff --git a/_assets/src/components/Main.vue b/_assets/src/components/Main.vue
index fa7c6215..4f4c3172 100644
--- a/_assets/src/components/Main.vue
+++ b/_assets/src/components/Main.vue
@@ -9,6 +9,9 @@
+
@@ -141,7 +144,7 @@ export default {
window.addEventListener('keydown', (event) => {
// Esc!
if (event.keyCode === 27) {
- this.$store.commit('closePrompts')
+ this.$store.commit('closeHovers')
// Unselect all files and folders.
if (this.req.kind === 'listing') {
@@ -159,20 +162,20 @@ export default {
// Del!
if (event.keyCode === 46) {
if (this.showDeleteButton()) {
- this.$store.commit('showPrompt', 'delete')
+ this.$store.commit('showHover', 'delete')
}
}
// F1!
if (event.keyCode === 112) {
event.preventDefault()
- this.$store.commit('showPrompt', 'help')
+ this.$store.commit('showHover', 'help')
}
// F2!
if (event.keyCode === 113) {
if (this.showRenameButton()) {
- this.$store.commit('showPrompt', 'rename')
+ this.$store.commit('showHover', 'rename')
}
}
@@ -201,7 +204,7 @@ export default {
// Reset selected items and multiple selection.
this.$store.commit('resetSelected')
this.$store.commit('multiple', false)
- this.$store.commit('closePrompts')
+ this.$store.commit('closeHovers')
let url = this.$route.path
if (url === '') url = '/'
@@ -224,6 +227,9 @@ export default {
this.loading = false
})
},
+ openSearch () {
+ this.$store.commit('showHover', 'search')
+ },
showUpload: function () {
if (this.req.kind === 'editor') return false
return this.user.allowNew
diff --git a/_assets/src/components/Search.vue b/_assets/src/components/Search.vue
index 197885c5..ef214703 100644
--- a/_assets/src/components/Search.vue
+++ b/_assets/src/components/Search.vue
@@ -41,7 +41,6 @@ export default {
data: function () {
return {
value: '',
- active: false,
ongoing: false,
scrollable: null,
search: [],
@@ -49,7 +48,11 @@ export default {
}
},
computed: {
- ...mapState(['user']),
+ ...mapState(['user', 'show']),
+ // Computed property for activeness of search.
+ active () {
+ return (this.show === 'search')
+ },
// Placeholder value.
placeholder: function () {
if (this.user.allowCommands && this.user.commands.length > 0) {
@@ -88,14 +91,14 @@ export default {
// when it's pressed, it closes the search window.
window.addEventListener('keydown', (event) => {
if (event.keyCode === 27) {
- this.active = false
+ this.$store.commit('closeHovers')
}
})
},
methods: {
// Sets the search to active.
open: function (event) {
- this.active = true
+ this.$store.commit('showHover', 'search')
},
// Closes the search and prevents the event
// of propagating so it doesn't trigger the
@@ -103,7 +106,7 @@ export default {
close: function (event) {
event.stopPropagation()
event.preventDefault()
- this.active = false
+ this.$store.commit('closeHovers')
},
// Checks if the current input is a supported command.
supported: function () {
@@ -127,7 +130,6 @@ export default {
return
}
- this.active = true
this.search.length = 0
this.commands.length = 0
},
diff --git a/_assets/src/components/Sidebar.vue b/_assets/src/components/Sidebar.vue
index 4d92be61..9b0318c9 100644
--- a/_assets/src/components/Sidebar.vue
+++ b/_assets/src/components/Sidebar.vue
@@ -6,12 +6,12 @@
-
@@ -22,9 +22,9 @@ export default {
...mapState(['req', 'selected'])
},
methods: {
- ...mapMutations(['closePrompts']),
+ ...mapMutations(['closeHovers']),
submit: function (event) {
- this.closePrompts()
+ this.closeHovers()
// buttons.setLoading('delete')
if (this.req.kind !== 'listing') {
diff --git a/_assets/src/components/prompts/Download.vue b/_assets/src/components/prompts/Download.vue
index 76809b40..18b401ba 100644
--- a/_assets/src/components/prompts/Download.vue
+++ b/_assets/src/components/prompts/Download.vue
@@ -34,7 +34,7 @@ export default {
api.download(format, ...files)
}
- this.$store.commit('closePrompts')
+ this.$store.commit('closeHovers')
}
}
}
diff --git a/_assets/src/components/prompts/Help.vue b/_assets/src/components/prompts/Help.vue
index 3873c127..454e76bf 100644
--- a/_assets/src/components/prompts/Help.vue
+++ b/_assets/src/components/prompts/Help.vue
@@ -20,7 +20,7 @@
- OK
+ OK
diff --git a/_assets/src/components/prompts/Info.vue b/_assets/src/components/prompts/Info.vue
index 3d54d797..df6e5300 100644
--- a/_assets/src/components/prompts/Info.vue
+++ b/_assets/src/components/prompts/Info.vue
@@ -21,7 +21,7 @@