Close handling
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
This commit is contained in:
parent
6201b0b5b1
commit
2e52bdda21
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -75,15 +75,6 @@ export default class Sidebar {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Close the sidebar
|
|
||||||
*
|
|
||||||
* @memberof Sidebar
|
|
||||||
*/
|
|
||||||
close() {
|
|
||||||
this.#state.file = ''
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return current opened file
|
* Return current opened file
|
||||||
*
|
*
|
||||||
|
|
|
@ -57,4 +57,5 @@ window.addEventListener('DOMContentLoaded', () => {
|
||||||
})
|
})
|
||||||
AppSidebar.$mount('#app-sidebar')
|
AppSidebar.$mount('#app-sidebar')
|
||||||
window.OCA.Files.Sidebar.open = AppSidebar.open
|
window.OCA.Files.Sidebar.open = AppSidebar.open
|
||||||
|
window.OCA.Files.Sidebar.close = AppSidebar.close
|
||||||
})
|
})
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
ref="sidebar"
|
ref="sidebar"
|
||||||
v-bind="appSidebar"
|
v-bind="appSidebar"
|
||||||
:force-menu="true"
|
:force-menu="true"
|
||||||
@close="onClose"
|
@close="close"
|
||||||
@update:active="setActiveTab"
|
@update:active="setActiveTab"
|
||||||
@update:starred="toggleStarred"
|
@update:starred="toggleStarred"
|
||||||
@[defaultActionListener].stop.prevent="onDefaultAction">
|
@[defaultActionListener].stop.prevent="onDefaultAction">
|
||||||
|
@ -250,10 +250,6 @@ export default {
|
||||||
canDisplay(tab) {
|
canDisplay(tab) {
|
||||||
return tab.isEnabled(this.fileInfo)
|
return tab.isEnabled(this.fileInfo)
|
||||||
},
|
},
|
||||||
onClose() {
|
|
||||||
this.resetData()
|
|
||||||
OCA.Files.Sidebar.close()
|
|
||||||
},
|
|
||||||
resetData() {
|
resetData() {
|
||||||
this.error = null
|
this.error = null
|
||||||
this.fileInfo = null
|
this.fileInfo = null
|
||||||
|
@ -381,8 +377,9 @@ export default {
|
||||||
/**
|
/**
|
||||||
* Open the sidebar for the given file
|
* Open the sidebar for the given file
|
||||||
*
|
*
|
||||||
* @memberof Sidebar
|
|
||||||
* @param {string} path the file path to load
|
* @param {string} path the file path to load
|
||||||
|
* @returns {Promise}
|
||||||
|
* @throws {Error} loading failure
|
||||||
*/
|
*/
|
||||||
async open(path) {
|
async open(path) {
|
||||||
// update current opened file
|
// update current opened file
|
||||||
|
@ -415,6 +412,14 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close the sidebar
|
||||||
|
*/
|
||||||
|
close() {
|
||||||
|
this.Sidebar.file = ''
|
||||||
|
this.resetData()
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue