|
|
@@ -1,5 +1,16 @@
|
|
|
<html>
|
|
|
<head>
|
|
|
+<style>
|
|
|
+ html,
|
|
|
+ body,
|
|
|
+ #objInfoApp {
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ #objInfoApp {
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+</style>
|
|
|
</head>
|
|
|
<body>
|
|
|
|
|
|
@@ -40,6 +51,28 @@
|
|
|
window.objInfoNextTabIndex = Number("<txt.ss val='${ssNextTabNo}'/>");
|
|
|
window.objInfoTabHeight = <txt.ss val="${tabHeight}"/> || {};
|
|
|
|
|
|
+ function objInfoFitDialogToViewport() {
|
|
|
+ if (!wd || !wd.display || typeof wd.display.getwdDialogWindows !== "function")
|
|
|
+ return;
|
|
|
+
|
|
|
+ const dialog = wd.display.getwdDialogWindows();
|
|
|
+ if (!dialog || typeof dialog.getDimension !== "function")
|
|
|
+ return;
|
|
|
+
|
|
|
+ const dimension = dialog.getDimension();
|
|
|
+ const maxWidth = Math.max(320, wd.topWindow.innerWidth - 20);
|
|
|
+ const maxHeight = Math.max(320, wd.topWindow.innerHeight - 20);
|
|
|
+ const width = Math.min(dimension[0], maxWidth);
|
|
|
+ const height = Math.min(dimension[1], maxHeight);
|
|
|
+
|
|
|
+ if (width === dimension[0] && height === dimension[1])
|
|
|
+ return;
|
|
|
+
|
|
|
+ dialog.setDimension(width, height);
|
|
|
+ dialog.keepInViewport(true);
|
|
|
+ dialog.center();
|
|
|
+ }
|
|
|
+
|
|
|
function objInfoFitHeight() {
|
|
|
const iframe = document.querySelector("#sub-tab-iframe");
|
|
|
const param = window.objInfoTabHeight || {};
|
|
|
@@ -131,6 +164,7 @@
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
+ setTimeout(objInfoFitDialogToViewport, 0);
|
|
|
setTimeout(objInfoFitHeight, 0);
|
|
|
this.showTagState("<varServ.ss name='wrTabState' parm='{ssObjName:\"${ssObjName}\",ssObjId:\"${ssObjId}\",\"${ssObjIdName}\":\"${ssObjId}\",dataType:\"${dataType}\"}'/>");
|
|
|
}
|
|
|
@@ -152,6 +186,8 @@
|
|
|
|
|
|
setTimeout(objInfoFitHeight, 200);
|
|
|
setTimeout(objInfoFitHeight, 800);
|
|
|
+ setTimeout(objInfoFitDialogToViewport, 200);
|
|
|
+ setTimeout(objInfoFitDialogToViewport, 800);
|
|
|
});
|
|
|
</script>
|
|
|
|