|
@@ -261,6 +261,38 @@ window.instances.UI.loadDocument = async (file) => {
|
|
|
await handlePdf(url, filename)
|
|
|
useViewer.setUploadLoading(false)
|
|
|
}
|
|
|
+
|
|
|
+window.instances.UI.closeDocument = async () => {
|
|
|
+ if (isLeftPanelOpen.value) {
|
|
|
+ core.toggleSidebar()
|
|
|
+ }
|
|
|
+ useViewer.$patch({
|
|
|
+ fullMode: false,
|
|
|
+ currentPage: 0,
|
|
|
+ scale: '',
|
|
|
+ themeMode: 'Light',
|
|
|
+ pageMode: 0,
|
|
|
+ scrollMode: 'Vertical',
|
|
|
+ activeTab: 0,
|
|
|
+ searchStatus: false,
|
|
|
+ activeElements: {
|
|
|
+ leftPanel: false,
|
|
|
+ rightPanel: false
|
|
|
+ },
|
|
|
+ activeElementsTab: {
|
|
|
+ leftPanelTab: 'THUMBS',
|
|
|
+ rightPanelTab: 'GENERAL'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ useDocument.resetSetting()
|
|
|
+ core.clearSearchResults()
|
|
|
+ useDocument.setToolState('')
|
|
|
+ useViewer.setActiceToolMode('view')
|
|
|
+
|
|
|
+ useViewer.setUpload(false)
|
|
|
+ useViewer.setUploadLoading(false)
|
|
|
+ await core.closeDocument()
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|