Created
September 18, 2018 12:42
-
-
Save du5rte/fce95b846c33905c83316b4c172605b0 to your computer and use it in GitHub Desktop.
Pop up
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function popup(url, {name='', width=500, height=500}={}) { | |
// References | |
// https://developer.mozilla.org/en-US/docs/Web/API/Window/open | |
let options = ` | |
width=${width}, | |
height=${height}, | |
left=${window.screenX + ((window.outerWidth - width) / 2)}, | |
top=${window.screenY + ((window.outerHeight - height) / 2)} | |
` | |
window.open(url, name, options) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment