@ombori/ga-gridapp-iframe
Advanced tools
Comparing version 2.166.0 to 2.197.1
@@ -6,2 +6,13 @@ # Change Log | ||
## [2.197.1](https://github.com/ombori/gridapp/compare/v2.197.0...v2.197.1) (2022-04-16) | ||
### Bug Fixes | ||
* automatically adapt to equivalent of 1080p resolution ([74c4ffa](https://github.com/ombori/gridapp/commit/74c4ffad347efca7d3569e8be54bca549707176c)) | ||
# [2.166.0](https://github.com/ombori/gridapp/compare/v2.165.2...v2.166.0) (2022-02-02) | ||
@@ -8,0 +19,0 @@ |
@@ -24,11 +24,2 @@ var __assign = (this && this.__assign) || function () { | ||
import React, { useEffect, useRef } from 'react'; | ||
var iframeStyles = { | ||
position: 'absolute', | ||
top: 0, | ||
right: 0, | ||
bottom: 0, | ||
left: 0, | ||
border: 0, | ||
zIndex: 1, | ||
}; | ||
var GridappIframe = function (props) { | ||
@@ -76,3 +67,22 @@ var root = props.root, id = props.id, settings = props.settings, src = props.src, restProps = __rest(props, ["root", "id", "settings", "src"]); | ||
}, []); | ||
return (React.createElement("iframe", __assign({ style: iframeStyles, title: "Gridapp", scrolling: "no", width: "100%", height: "100%", ref: iframeRefContainer, src: src }, restProps))); | ||
var width = window.innerWidth; | ||
var height = window.innerHeight; | ||
var isPortrait = width < height; | ||
var scalingFactor = isPortrait ? width / 1080 : height / 1080; | ||
var scaledHeight = isPortrait ? height / scalingFactor : 1080; | ||
var scaledWidth = isPortrait ? 1080 : width / scalingFactor; | ||
// console.log({width, height, isPortrait, scalingFactor, scaledHeight, scaledWidth}); | ||
var iframeStyles = { | ||
position: 'absolute', | ||
transform: "scale(" + scalingFactor + ")", | ||
transformOrigin: '0 0', | ||
top: 0, | ||
left: 0, | ||
width: scaledWidth, | ||
height: scaledHeight, | ||
border: 0, | ||
zIndex: 1, | ||
}; | ||
return (React.createElement("div", null, | ||
React.createElement("iframe", __assign({ style: iframeStyles, title: "Gridapp", scrolling: "no", width: "100%", height: "100%", ref: iframeRefContainer, src: src }, restProps)))); | ||
}; | ||
@@ -79,0 +89,0 @@ var handleIframeReady = function (iFrame, fn) { |
{ | ||
"name": "@ombori/ga-gridapp-iframe", | ||
"version": "2.166.0", | ||
"version": "2.197.1", | ||
"main": "dist/index.js", | ||
@@ -16,3 +16,3 @@ "license": "UNLICENSED", | ||
}, | ||
"gitHead": "54db643a5a2873a62879148ed9e69dc8ddd5faa8" | ||
"gitHead": "09510536352d7c34efcc7ae796800f03934a83ce" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
15366
321