diff options
author | oyron <oyron@statoil.com> | 2018-10-05 15:18:08 +0200 |
---|---|---|
committer | oyron <oyron@statoil.com> | 2018-10-05 15:18:08 +0200 |
commit | f32cd8586d2564f531ae87630c8d6a120a2b82a0 (patch) | |
tree | 9f8545de2e35e076e8908ddf8b3a4a414051f5fc | |
parent | c35cce54a5d4800b90e71a43da140c0347308989 (diff) | |
download | freenode-live-2017-presentation-f32cd8586d2564f531ae87630c8d6a120a2b82a0.tar freenode-live-2017-presentation-f32cd8586d2564f531ae87630c8d6a120a2b82a0.tar.gz |
Handle previously opened notes window, by giving focus.
-rw-r--r-- | plugin/notes/notes.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/plugin/notes/notes.js b/plugin/notes/notes.js index a5b15b4..c9993c4 100644 --- a/plugin/notes/notes.js +++ b/plugin/notes/notes.js @@ -11,15 +11,22 @@ */ var RevealNotes = (function() { + var notesPopup = null; + function openNotes( notesFilePath ) { + if (notesPopup && !notesPopup.closed) { + notesPopup.focus(); + return; + } + if( !notesFilePath ) { var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path notesFilePath = jsFileLocation + 'notes.html'; } - var notesPopup = window.open( notesFilePath, 'reveal.js - Notes', 'width=1100,height=700' ); + notesPopup = window.open( notesFilePath, 'reveal.js - Notes', 'width=1100,height=700' ); if( !notesPopup ) { alert( 'Speaker view popup failed to open. Please make sure popups are allowed and reopen the speaker view.' ); |