한글뷰어 기능수정 Ver.01
This commit is contained in:
@@ -5487,6 +5487,7 @@ export async function renderViewer(resourcePath, dataId, shouldAddClickLog = tru
|
||||
|
||||
function viewerExcel(presignedUrl) {
|
||||
vars.viewer.innerHTML = '<div style="display:flex;justify-content:center;align-items:center;height:100%;font-size:1.2rem;color:#666;background:#fff;">엑셀 데이터를 불러오는 중...</div>';
|
||||
initMainFallbackPdfButton(dataId, resourcePath, objectKey, previewKey);
|
||||
|
||||
fetch(presignedUrl)
|
||||
.then(res => {
|
||||
@@ -5616,18 +5617,33 @@ export async function renderViewer(resourcePath, dataId, shouldAddClickLog = tru
|
||||
const container = document.createElement('div');
|
||||
container.style.width = '100%';
|
||||
container.style.height = '100%';
|
||||
container.style.overflow = 'auto';
|
||||
container.style.overflowX = 'auto';
|
||||
container.style.overflowY = 'auto';
|
||||
container.style.padding = '20px';
|
||||
container.style.boxSizing = 'border-box';
|
||||
container.style.background = '#f5f5f5';
|
||||
|
||||
const styleEl = document.createElement('style');
|
||||
styleEl.textContent = `
|
||||
.hwp-inner-container {
|
||||
background: #ffffff;
|
||||
margin: 0 auto;
|
||||
width: max-content;
|
||||
min-width: 800px;
|
||||
box-shadow: 0 4px 10px rgba(0,0,0,0.1);
|
||||
padding: 0 !important;
|
||||
box-sizing: border-box !important;
|
||||
min-height: 100%;
|
||||
}
|
||||
.hwp-inner-container img {
|
||||
max-width: 100% !important;
|
||||
height: auto !important;
|
||||
}
|
||||
`;
|
||||
container.appendChild(styleEl);
|
||||
|
||||
const hwpInner = document.createElement('div');
|
||||
hwpInner.style.background = '#ffffff';
|
||||
hwpInner.style.margin = '0 auto';
|
||||
hwpInner.style.maxWidth = '800px';
|
||||
hwpInner.style.boxShadow = '0 4px 10px rgba(0,0,0,0.1)';
|
||||
hwpInner.style.padding = '40px';
|
||||
hwpInner.style.minHeight = '100%';
|
||||
hwpInner.classList.add('hwp-inner-container');
|
||||
|
||||
container.appendChild(hwpInner);
|
||||
vars.viewer.appendChild(container);
|
||||
|
||||
@@ -733,6 +733,7 @@ export async function renderDocViewer(resourcePath, docId) {
|
||||
|
||||
function viewerExcel(presignedUrl) {
|
||||
docVars.viewer.innerHTML = '<div style="display:flex;justify-content:center;align-items:center;height:100%;font-size:1.2rem;color:#666;background:#fff;">엑셀 데이터를 불러오는 중...</div>';
|
||||
initDocFallbackPdfButton(docId, resourcePath, objectKey, previewKey);
|
||||
|
||||
fetch(presignedUrl)
|
||||
.then(res => {
|
||||
@@ -862,7 +863,7 @@ export async function renderDocViewer(resourcePath, docId) {
|
||||
const container = document.createElement('div');
|
||||
container.style.width = '100%';
|
||||
container.style.height = '100%';
|
||||
container.style.overflowX = 'hidden';
|
||||
container.style.overflowX = 'auto';
|
||||
container.style.overflowY = 'auto';
|
||||
container.style.padding = '20px';
|
||||
container.style.boxSizing = 'border-box';
|
||||
@@ -873,38 +874,17 @@ export async function renderDocViewer(resourcePath, docId) {
|
||||
.hwp-inner-container {
|
||||
background: #ffffff;
|
||||
margin: 0 auto;
|
||||
max-width: 800px;
|
||||
width: max-content;
|
||||
min-width: 800px;
|
||||
box-shadow: 0 4px 10px rgba(0,0,0,0.1);
|
||||
padding: 30px !important;
|
||||
padding: 0 !important;
|
||||
box-sizing: border-box !important;
|
||||
min-height: 100%;
|
||||
}
|
||||
.hwp-inner-container > div > div {
|
||||
max-width: 100% !important;
|
||||
height: auto !important;
|
||||
box-sizing: border-box !important;
|
||||
padding-left: 20px !important;
|
||||
padding-right: 20px !important;
|
||||
margin-bottom: 20px !important;
|
||||
}
|
||||
.hwp-inner-container table {
|
||||
max-width: 100% !important;
|
||||
width: 100% !important;
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
.hwp-inner-container img {
|
||||
max-width: 100% !important;
|
||||
height: auto !important;
|
||||
}
|
||||
@media (max-width: 600px) {
|
||||
.hwp-inner-container {
|
||||
padding: 10px !important;
|
||||
}
|
||||
.hwp-inner-container > div > div {
|
||||
padding-left: 10px !important;
|
||||
padding-right: 10px !important;
|
||||
}
|
||||
}
|
||||
`;
|
||||
container.appendChild(styleEl);
|
||||
|
||||
|
||||
@@ -674,6 +674,10 @@ function _openExcel(path, data) {
|
||||
const viewer = document.getElementById('popup_viewer');
|
||||
viewer.innerHTML = '<div style="display:flex;justify-content:center;align-items:center;height:100%;font-size:1.2rem;color:#666;background:#fff;">엑셀 데이터를 불러오는 중...</div>';
|
||||
|
||||
if (dataId && path_name) {
|
||||
initFallbackPdfButton(dataId, path_name, resourcePath);
|
||||
}
|
||||
|
||||
fetch(path)
|
||||
.then(res => {
|
||||
if (!res.ok) throw new Error(`HTTP ${res.status} ${res.statusText}`);
|
||||
@@ -815,7 +819,7 @@ function _openHwp(path, data) {
|
||||
const container = document.createElement('div');
|
||||
container.style.width = '100%';
|
||||
container.style.height = '100%';
|
||||
container.style.overflowX = 'hidden';
|
||||
container.style.overflowX = 'auto';
|
||||
container.style.overflowY = 'auto';
|
||||
container.style.padding = '20px';
|
||||
container.style.boxSizing = 'border-box';
|
||||
@@ -826,38 +830,17 @@ function _openHwp(path, data) {
|
||||
.hwp-inner-container {
|
||||
background: #ffffff;
|
||||
margin: 0 auto;
|
||||
max-width: 800px;
|
||||
width: max-content;
|
||||
min-width: 800px;
|
||||
box-shadow: 0 4px 10px rgba(0,0,0,0.1);
|
||||
padding: 30px !important;
|
||||
padding: 0 !important;
|
||||
box-sizing: border-box !important;
|
||||
min-height: 100%;
|
||||
}
|
||||
.hwp-inner-container > div > div {
|
||||
max-width: 100% !important;
|
||||
height: auto !important;
|
||||
box-sizing: border-box !important;
|
||||
padding-left: 20px !important;
|
||||
padding-right: 20px !important;
|
||||
margin-bottom: 20px !important;
|
||||
}
|
||||
.hwp-inner-container table {
|
||||
max-width: 100% !important;
|
||||
width: 100% !important;
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
.hwp-inner-container img {
|
||||
max-width: 100% !important;
|
||||
height: auto !important;
|
||||
}
|
||||
@media (max-width: 600px) {
|
||||
.hwp-inner-container {
|
||||
padding: 10px !important;
|
||||
}
|
||||
.hwp-inner-container > div > div {
|
||||
padding-left: 10px !important;
|
||||
padding-right: 10px !important;
|
||||
}
|
||||
}
|
||||
`;
|
||||
container.appendChild(styleEl);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user