|
@@ -1242,8 +1242,11 @@ const preview = async () => {
|
|
// id: data._id,
|
|
// id: data._id,
|
|
// },
|
|
// },
|
|
// });
|
|
// });
|
|
- let screenWidth = window.screen.width;
|
|
|
|
- let screenHeight = window.screen.height;
|
|
|
|
|
|
+ // let screenWidth = window.screen.width;
|
|
|
|
+ // let screenHeight = window.screen.height;
|
|
|
|
+ let width = meta2d.store.data.width||meta2d.store.options.width||1920;
|
|
|
|
+ let height = meta2d.store.data.height||meta2d.store.options.height||1080;
|
|
|
|
+ let minScle = Math.min(window.innerWidth/width,window.innerHeight/height);
|
|
let url = `/preview?r=${Date.now() + ''}`;
|
|
let url = `/preview?r=${Date.now() + ''}`;
|
|
if (data.id) {
|
|
if (data.id) {
|
|
url += `&id=${data.id}`;
|
|
url += `&id=${data.id}`;
|
|
@@ -1251,7 +1254,7 @@ const preview = async () => {
|
|
window.open(
|
|
window.open(
|
|
url,
|
|
url,
|
|
'',
|
|
'',
|
|
- `height=${screenHeight},width=${screenWidth},top=0,left=0,toolbar=no,menubar=no, scrollbars=no,resizable=no,location=no, status=no`
|
|
|
|
|
|
+ `height=${minScle*height},width=${minScle*width},top=0,left=${(window.innerWidth-minScle*width)/2},toolbar=no,menubar=no, scrollbars=no,resizable=no,location=no, status=no`
|
|
);
|
|
);
|
|
};
|
|
};
|
|
|
|
|