Created
July 30, 2018 22:12
-
-
Save astrotars/a66ab9675f66af437925cd23ed813030 to your computer and use it in GitHub Desktop.
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
tweet(title, url) { | |
const getWindowOptions = function() { | |
const width = 500; | |
const height = 350; | |
const left = window.innerWidth / 2 - width / 2; | |
const top = window.innerHeight / 2 - height / 2; | |
return [ | |
'resizable,scrollbars,status', | |
'height=' + height, | |
'width=' + width, | |
'left=' + left, | |
'top=' + top, | |
].join(); | |
}; | |
const shareUrl = `https://twitter.com/intent/tweet?url=${url}&text=${title}&hashtags=Winds`; | |
const win = window.open(shareUrl, 'Share on Twitter', getWindowOptions()); | |
win.opener = null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment