Center share popup inside the browser window
This commit is contained in:
parent
4d4b79800a
commit
2c57c66195
1 changed files with 2 additions and 2 deletions
|
@ -2,8 +2,8 @@ function openShareUrl(url, initialWidth = 640, initialHeight = 480) {
|
|||
const width = Math.max(100, Math.min(screen.width, initialWidth));
|
||||
const height = Math.max(100, Math.min(screen.height, initialHeight));
|
||||
|
||||
const left = (screen.width / 2) - (width / 2);
|
||||
const top = (screen.height * 0.3) - (height / 2);
|
||||
const left = screenLeft + ((outerWidth - width) / 2);
|
||||
const top = screenTop + ((outerHeight - height) / 2);
|
||||
const opts = `width=${width},height=${height},left=${left},top=${top},menubar=no,status=no,location=no`;
|
||||
|
||||
window.open(url, "popup", opts);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue