X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6094a97ce6297d390e5bbf733f5c2b4cc6b2076c..HEAD:/app/assets/javascripts/social_share_button.js?ds=sidebyside diff --git a/app/assets/javascripts/social_share_button.js b/app/assets/javascripts/social_share_button.js index 409b2c58a..34db84758 100644 --- a/app/assets/javascripts/social_share_button.js +++ b/app/assets/javascripts/social_share_button.js @@ -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);