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
f4d298cc03
commit
b074be1b1d
5 changed files with 12 additions and 15 deletions
BIN
apps/files/js/dist/sidebar.js
vendored
BIN
apps/files/js/dist/sidebar.js
vendored
Binary file not shown.
BIN
apps/files/js/dist/sidebar.js.map
vendored
BIN
apps/files/js/dist/sidebar.js.map
vendored
Binary file not shown.
|
@ -75,15 +75,6 @@ export default class Sidebar {
|
|||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the sidebar
|
||||
*
|
||||
* @memberof Sidebar
|
||||
*/
|
||||
close() {
|
||||
this.#state.file = ''
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current opened file
|
||||
*
|
||||
|
|
|
@ -57,4 +57,5 @@ window.addEventListener('DOMContentLoaded', () => {
|
|||
})
|
||||
AppSidebar.$mount('#app-sidebar')
|
||||
window.OCA.Files.Sidebar.open = AppSidebar.open
|
||||
window.OCA.Files.Sidebar.close = AppSidebar.close
|
||||
})
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
ref="sidebar"
|
||||
v-bind="appSidebar"
|
||||
:force-menu="true"
|
||||
@close="onClose"
|
||||
@close="close"
|
||||
@update:active="setActiveTab"
|
||||
@update:starred="toggleStarred"
|
||||
@[defaultActionListener].stop.prevent="onDefaultAction">
|
||||
|
@ -251,10 +251,6 @@ export default {
|
|||
canDisplay(tab) {
|
||||
return tab.isEnabled(this.fileInfo)
|
||||
},
|
||||
onClose() {
|
||||
this.resetData()
|
||||
OCA.Files.Sidebar.close()
|
||||
},
|
||||
resetData() {
|
||||
this.error = null
|
||||
this.fileInfo = null
|
||||
|
@ -382,8 +378,9 @@ export default {
|
|||
/**
|
||||
* Open the sidebar for the given file
|
||||
*
|
||||
* @memberof Sidebar
|
||||
* @param {string} path the file path to load
|
||||
* @returns {Promise}
|
||||
* @throws {Error} loading failure
|
||||
*/
|
||||
async open(path) {
|
||||
// update current opened file
|
||||
|
@ -416,6 +413,14 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Close the sidebar
|
||||
*/
|
||||
close() {
|
||||
this.Sidebar.file = ''
|
||||
this.resetData()
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue