find correct path to open html file from the notes.js path
authorDamjan Georgievski <gdamjan@gmail.com>
Wed, 6 Feb 2013 11:24:04 +0000 (12:24 +0100)
committerDamjan Georgievski <gdamjan@gmail.com>
Wed, 6 Feb 2013 11:27:49 +0000 (12:27 +0100)
plugin/notes/notes.js

index 7c83366d0344126fde096741e915346fb5464c79..72f6a107437fcf306a6726fa22667d21914d8d1b 100644 (file)
@@ -5,7 +5,9 @@
 var RevealNotes = (function() {
 
        function openNotes() {
-               var notesPopup = window.open( 'plugin/notes/notes.html', 'reveal.js - Notes', 'width=1120,height=850' );
+               var jsFileLocation = document.querySelector('script[src*=notes]').src;  // this js file path
+               jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, '');   // the js folder path
+               var notesPopup = window.open( jsFileLocation + 'notes.html', 'reveal.js - Notes', 'width=1120,height=850' );
 
                // Fires when slide is changed
                Reveal.addEventListener( 'slidechanged', function( event ) {