mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-21 15:36:18 -05:00
Modifying height of iframes for Map/Zim viewers to show full page of iframe.
This commit is contained in:
parent
ed1ed94beb
commit
62c4afce0b
4 changed files with 37 additions and 19 deletions
|
|
@ -21,6 +21,7 @@ import {SemanticToastContainer} from "react-semantic-toasts-2";
|
|||
import {FilePreviewProvider} from "./components/FilePreview";
|
||||
import {TagsProvider} from "./Tags";
|
||||
import {ZimRoute} from "./components/Zim";
|
||||
import {IframeViewer} from "./components/Common";
|
||||
|
||||
function PageNotFound() {
|
||||
const {t} = useContext(ThemeContext);
|
||||
|
|
|
|||
|
|
@ -1676,3 +1676,35 @@ export const monthNames = [
|
|||
'November',
|
||||
'December',
|
||||
];
|
||||
|
||||
export function IframeViewer({title, viewerUrl}) {
|
||||
// Bottom of iframe is hidden when height is 100%. These values display the entire iframe.
|
||||
return <>
|
||||
<Media at='mobile'>
|
||||
<iframe
|
||||
title={title}
|
||||
src={viewerUrl}
|
||||
style={{
|
||||
position: 'fixed',
|
||||
height: '80%',
|
||||
width: '100%',
|
||||
border: 'none',
|
||||
padding: 0,
|
||||
backgroundColor: '#FFFFFF',
|
||||
}}/>
|
||||
</Media>
|
||||
<Media greaterThan='mobile'>
|
||||
<iframe
|
||||
title={title}
|
||||
src={viewerUrl}
|
||||
style={{
|
||||
position: 'fixed',
|
||||
height: '93%',
|
||||
width: '100%',
|
||||
border: 'none',
|
||||
padding: 0,
|
||||
backgroundColor: '#FFFFFF',
|
||||
}}/>
|
||||
</Media>
|
||||
</>
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ import {
|
|||
ErrorMessage,
|
||||
HelpPopup,
|
||||
humanFileSize,
|
||||
IframeViewer,
|
||||
InfoMessage,
|
||||
PageContainer,
|
||||
TabLinks,
|
||||
|
|
@ -281,15 +282,7 @@ class ManageMap extends React.Component {
|
|||
}
|
||||
|
||||
function MapPage() {
|
||||
return <iframe
|
||||
title='map'
|
||||
src={`http://${window.location.hostname}:8084/`}
|
||||
style={{
|
||||
position: 'fixed',
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
border: 'none',
|
||||
}}/>
|
||||
return <IframeViewer title='map' viewerUrl={`http://${window.location.hostname}:8084/`}/>
|
||||
}
|
||||
|
||||
export function MapRoute() {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import {
|
|||
encodeMediaPath,
|
||||
ErrorMessage,
|
||||
humanFileSize,
|
||||
IframeViewer,
|
||||
InfoMessage,
|
||||
normalizeEstimate,
|
||||
PageContainer,
|
||||
|
|
@ -529,16 +530,7 @@ class ManageZim extends React.Component {
|
|||
}
|
||||
|
||||
function ZimViewer() {
|
||||
return <iframe
|
||||
title='zim'
|
||||
src={VIEWER_URL}
|
||||
style={{
|
||||
position: 'fixed',
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
border: 'none',
|
||||
backgroundColor: '#FFFFFF',
|
||||
}}/>
|
||||
return <IframeViewer title='zim' viewerUrl={VIEWER_URL}/>
|
||||
}
|
||||
|
||||
export function ZimRoute() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue