Guest User

Untitled

a guest
Jul 15th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. checkPopup() {
  2. const check = setInterval(() => {
  3. const { popup } = this
  4. if (!popup || popup.closed || popup.closed === undefined) {
  5. clearInterval(check);
  6. this.setState({ disabled: ''})
  7. }
  8. }, 1000)
  9. }
  10.  
  11. openPopup() {
  12. const width = 600, height = 600
  13. const left = (window.innerWidth / 2) - (width / 2)
  14. const top = (window.innerHeight / 2) - (height / 2)
  15.  
  16. const url = `${API_URL}/twitter?socketId=${socket.id}`
  17.  
  18. return window.open(url, '',
  19. `toolbar=no, location=no, directories=no, status=no, menubar=no,
  20. scrollbars=no, resizable=no, copyhistory=no, width=${width},
  21. height=${height}, top=${top}, left=${left}`
  22. )
  23. }
Add Comment
Please, Sign In to add comment