Skip to content

Commit

Permalink
fix: 修复预览弹窗
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Jan 17, 2024
1 parent bcb48df commit 9ea891f
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store-front-end",
"version": "2.14.67",
"version": "2.14.69",
"private": true,
"scripts": {
"dev": "vite --host",
Expand Down
15 changes: 15 additions & 0 deletions src/components/FileListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@
});
const closePreview = () => {
document.querySelector('html').style['overflow-y'] = '';
document.querySelector('html').style.height = '';
document.body.style.height = '';
document.body.style['overflow-y'] = '';
(document.querySelector('#app') as HTMLElement).style['overflow-y'] = '';
(document.querySelector('#app') as HTMLElement).style.height = '';
filePreviewIsVisible.value = false;
router.back();
};
Expand All @@ -260,6 +267,14 @@
if (res?.data?.status === 'success') {
previewData.value = res.data.data;
document.querySelector('html').style['overflow-y'] = 'hidden';
document.querySelector('html').style.height = '100%';
document.body.style.height = '100%';
document.body.style['overflow-y'] = 'hidden';
(document.querySelector('#app') as HTMLElement).style['overflow-y'] = 'hidden';
(document.querySelector('#app') as HTMLElement).style.height = '100%';
filePreviewIsVisible.value = true;
Toast.hide('compare');
}
Expand Down
15 changes: 15 additions & 0 deletions src/components/SubListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,13 @@
});
const closeCompare = () => {
document.querySelector('html').style['overflow-y'] = '';
document.querySelector('html').style.height = '';
document.body.style.height = '';
document.body.style['overflow-y'] = '';
(document.querySelector('#app') as HTMLElement).style['overflow-y'] = '';
(document.querySelector('#app') as HTMLElement).style.height = '';
compareTableIsVisible.value = false;
router.back();
};
Expand All @@ -338,6 +345,14 @@
);
if (res?.data?.status === 'success') {
compareData.value = res.data.data;
document.querySelector('html').style['overflow-y'] = 'hidden';
document.querySelector('html').style.height = '100%';
document.body.style.height = '100%';
document.body.style['overflow-y'] = 'hidden';
(document.querySelector('#app') as HTMLElement).style['overflow-y'] = 'hidden';
(document.querySelector('#app') as HTMLElement).style.height = '100%';
compareTableIsVisible.value = true;
Toast.hide('compare');
}
Expand Down
15 changes: 15 additions & 0 deletions src/views/FileEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,13 @@
deleteItem(form, actionsList, actionsChecked, id);
};
const closePreview = () => {
document.querySelector('html').style['overflow-y'] = '';
document.querySelector('html').style.height = '';
document.body.style.height = '';
document.body.style['overflow-y'] = '';
(document.querySelector('#app') as HTMLElement).style['overflow-y'] = '';
(document.querySelector('#app') as HTMLElement).style.height = '';
filePreviewIsVisible.value = false;
router.back();
};
Expand Down Expand Up @@ -343,6 +350,14 @@
const res = await subsApi.compareSub('file', data);
if (res?.data?.status === 'success') {
previewData.value = res.data.data;
document.querySelector('html').style['overflow-y'] = 'hidden';
document.querySelector('html').style.height = '100%';
document.body.style.height = '100%';
document.body.style['overflow-y'] = 'hidden';
(document.querySelector('#app') as HTMLElement).style['overflow-y'] = 'hidden';
(document.querySelector('#app') as HTMLElement).style.height = '100%';
filePreviewIsVisible.value = true;
Toast.hide('compare');
}
Expand Down
3 changes: 3 additions & 0 deletions src/views/FilePreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@
}
.compare-page-wrapper {
top: 0;
left: 0;
position: absolute;
width: 100vw;
height: 100vh;
z-index: 1000;
Expand Down
15 changes: 15 additions & 0 deletions src/views/SubEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,13 @@
};
const closeCompare = () => {
document.querySelector('html').style['overflow-y'] = '';
document.querySelector('html').style.height = '';
document.body.style.height = '';
document.body.style['overflow-y'] = '';
(document.querySelector('#app') as HTMLElement).style['overflow-y'] = '';
(document.querySelector('#app') as HTMLElement).style.height = '';
compareTableIsVisible.value = false;
router.back();
};
Expand Down Expand Up @@ -453,6 +460,14 @@
const res = await subsApi.compareSub(type, data);
if (res?.data?.status === 'success') {
compareData.value = res.data.data;
document.querySelector('html').style['overflow-y'] = 'hidden';
document.querySelector('html').style.height = '100%';
document.body.style.height = '100%';
document.body.style['overflow-y'] = 'hidden';
(document.querySelector('#app') as HTMLElement).style['overflow-y'] = 'hidden';
(document.querySelector('#app') as HTMLElement).style.height = '100%';
compareTableIsVisible.value = true;
Toast.hide('compare');
}
Expand Down

0 comments on commit 9ea891f

Please sign in to comment.