Compare commits
No commits in common. "d944697f9c5ba9e4e6291e8585812dcc535fb9a0" and "9766f4b6c391bafb1526a4415a844a901fc70c64" have entirely different histories.
d944697f9c
...
9766f4b6c3
@ -57,13 +57,7 @@ const NewDocumentJob = ({ onOk, defaultValues = {} }) => {
|
|||||||
disabled={downloading}
|
disabled={downloading}
|
||||||
sideBarGrow={true}
|
sideBarGrow={true}
|
||||||
sideBar={
|
sideBar={
|
||||||
<div
|
<div style={{ minHeight: '760px', flexGrow: 1 }}>
|
||||||
style={{
|
|
||||||
height: 'calc(100vh - 240px)',
|
|
||||||
flexGrow: 1,
|
|
||||||
minWidth: 0
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<TemplatePreview
|
<TemplatePreview
|
||||||
objectData={objectData?.object}
|
objectData={objectData?.object}
|
||||||
documentTemplate={objectData?.documentTemplate}
|
documentTemplate={objectData?.documentTemplate}
|
||||||
|
|||||||
@ -171,19 +171,6 @@ const TemplatePreview = ({
|
|||||||
setPreviewContentHTML(html)
|
setPreviewContentHTML(html)
|
||||||
}
|
}
|
||||||
|
|
||||||
const clearIframeContents = useCallback(() => {
|
|
||||||
iframeSizeObserverRef.current?.disconnect()
|
|
||||||
iframeSizeObserverRef.current = null
|
|
||||||
|
|
||||||
const iframe = iframeRef.current
|
|
||||||
if (iframe) {
|
|
||||||
iframe.srcdoc = ''
|
|
||||||
}
|
|
||||||
|
|
||||||
setPreviewContentHTML('')
|
|
||||||
setIframeSize({ width: '100%', height: 'auto' })
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
const stopRenderProgressListener = useCallback(() => {
|
const stopRenderProgressListener = useCallback(() => {
|
||||||
if (typeof renderUnsubscribeRef.current === 'function') {
|
if (typeof renderUnsubscribeRef.current === 'function') {
|
||||||
renderUnsubscribeRef.current()
|
renderUnsubscribeRef.current()
|
||||||
@ -554,11 +541,10 @@ const TemplatePreview = ({
|
|||||||
disabled={loading || reloadLoading}
|
disabled={loading || reloadLoading}
|
||||||
value={previewType}
|
value={previewType}
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
|
setPreviewType(value)
|
||||||
if (value == 'PDF') {
|
if (value == 'PDF') {
|
||||||
clearIframeContents()
|
|
||||||
setPDFBlob(null)
|
setPDFBlob(null)
|
||||||
}
|
}
|
||||||
setPreviewType(value)
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
@ -613,25 +599,12 @@ const TemplatePreview = ({
|
|||||||
cursor: panMode ? (isPanning ? 'grabbing' : 'grab') : undefined,
|
cursor: panMode ? (isPanning ? 'grabbing' : 'grab') : undefined,
|
||||||
touchAction: panMode ? 'none' : undefined
|
touchAction: panMode ? 'none' : undefined
|
||||||
}}
|
}}
|
||||||
>
|
|
||||||
<Flex
|
|
||||||
justify='center'
|
|
||||||
align='center'
|
|
||||||
style={{
|
|
||||||
minWidth: '100%',
|
|
||||||
width: iframeSize.width,
|
|
||||||
height: iframeSize.height
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
width: iframeSize.width,
|
width: iframeSize.width,
|
||||||
height: iframeSize.height,
|
height: iframeSize.height,
|
||||||
cursor: panMode
|
cursor: panMode ? (isPanning ? 'grabbing' : 'grab') : undefined
|
||||||
? isPanning
|
|
||||||
? 'grabbing'
|
|
||||||
: 'grab'
|
|
||||||
: undefined
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<iframe
|
<iframe
|
||||||
@ -650,7 +623,6 @@ const TemplatePreview = ({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Flex>
|
|
||||||
</ScrollBox>
|
</ScrollBox>
|
||||||
) : (
|
) : (
|
||||||
<PDFViewer
|
<PDFViewer
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user