@ombori/ga-gridapp-iframe
Advanced tools
Comparing version 2.197.3 to 2.197.4
@@ -6,2 +6,13 @@ # Change Log | ||
## [2.197.4](https://github.com/ombori/gridapp/compare/v2.197.3...v2.197.4) (2022-04-18) | ||
### Bug Fixes | ||
* do not autoscale mobile apps ([2d7e9ac](https://github.com/ombori/gridapp/commit/2d7e9aceb177bf2cbf5ddd5dd2496c47244db7c9)) | ||
## [2.197.3](https://github.com/ombori/gridapp/compare/v2.197.2...v2.197.3) (2022-04-17) | ||
@@ -8,0 +19,0 @@ |
@@ -6,2 +6,3 @@ import React from 'react'; | ||
settings: any; | ||
normalizeScaling: boolean; | ||
} | ||
@@ -8,0 +9,0 @@ declare const GridappIframe: (props: GridappIframeProps) => JSX.Element; |
@@ -27,2 +27,3 @@ var __assign = (this && this.__assign) || function () { | ||
var root = props.root, id = props.id, settings = props.settings, src = props.src, restProps = __rest(props, ["root", "id", "settings", "src"]); | ||
var disableScaling = !props.normalizeScaling; | ||
var iframeRefContainer = useRef(null); | ||
@@ -83,18 +84,23 @@ useEffect(function () { | ||
var isPortrait = width < height; | ||
var scalingFactor = isPortrait ? width / 1080 : height / 1080; | ||
var scaledHeight = isPortrait ? height / scalingFactor : 1080; | ||
var scaledWidth = isPortrait ? 1080 : width / scalingFactor; | ||
var iframeStyles = { | ||
position: 'absolute', | ||
transform: "scale(" + scalingFactor + ")", | ||
transform: '', | ||
transformOrigin: '0 0', | ||
top: 0, | ||
left: 0, | ||
width: scaledWidth, | ||
height: scaledHeight, | ||
width: width, | ||
height: height, | ||
border: 0, | ||
zIndex: 1, | ||
}; | ||
if (!disableScaling) { | ||
var scalingFactor = isPortrait ? width / 1080 : height / 1080; | ||
var scaledHeight = isPortrait ? height / scalingFactor : 1080; | ||
var scaledWidth = isPortrait ? 1080 : width / scalingFactor; | ||
iframeStyles.width = scaledWidth; | ||
iframeStyles.height = scaledHeight; | ||
iframeStyles.transform = "scale(" + scalingFactor + ")"; | ||
} | ||
return (React.createElement("div", null, | ||
React.createElement("iframe", __assign({ style: iframeStyles, title: "Gridapp", scrolling: "no", width: "100%", height: "100%", ref: iframeRefContainer, src: src }, restProps)))); | ||
React.createElement("iframe", __assign({ style: iframeStyles, title: "Gridapp", scrolling: "no", ref: iframeRefContainer, src: src }, restProps)))); | ||
}; | ||
@@ -101,0 +107,0 @@ var handleIframeReady = function (iFrame, fn) { |
{ | ||
"name": "@ombori/ga-gridapp-iframe", | ||
"version": "2.197.3", | ||
"version": "2.197.4", | ||
"main": "dist/index.js", | ||
@@ -16,3 +16,3 @@ "license": "UNLICENSED", | ||
}, | ||
"gitHead": "02b581142388b3c03e319951927e0f4133fce9b7" | ||
"gitHead": "66afc7d24ff7c5a4ebce76f448f29453624ca603" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
17102
357