aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2018-10-08 08:32:39 +0200
committerGitHub <noreply@github.com>2018-10-08 08:32:39 +0200
commite7a365255f0ceddf87d41f0debca19a074e754e9 (patch)
tree9fd743964131e7822a2e51d19b45def2f295df2a /plugin
parentfb089e70838ec9a673577c0274fc202ccfcda7c2 (diff)
parentf32cd8586d2564f531ae87630c8d6a120a2b82a0 (diff)
downloadperl-software-in-gnu-guix-e7a365255f0ceddf87d41f0debca19a074e754e9.tar
perl-software-in-gnu-guix-e7a365255f0ceddf87d41f0debca19a074e754e9.tar.gz
Merge pull request #2251 from oyron/2229-speaker-notes-bug
Give focus to previously opened speaker notes (fixes #2229)
Diffstat (limited to 'plugin')
-rw-r--r--plugin/notes/notes.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugin/notes/notes.js b/plugin/notes/notes.js
index fdefd75..8d58ad0 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.' );