notes window now displays correct slides when origin is different than index.html...
authorhakimel <hakim.elhattab@gmail.com>
Mon, 21 Jan 2013 18:05:09 +0000 (13:05 -0500)
committerhakimel <hakim.elhattab@gmail.com>
Mon, 21 Jan 2013 18:05:09 +0000 (13:05 -0500)
plugin/notes/notes.html

index 64b921cec1a4401e6d869303827f0b38a8182d85..aecef7cc1b18179536878acb4df5ee8be1c3eddc 100644 (file)
        <body>
 
                <div id="wrap-current-slide" class="slides">
-                       <iframe src="../../index.html" width="1280" height="1024" id="current-slide"></iframe>
+                       <iframe width="1280" height="1024" id="current-slide"></iframe>
                </div>
 
                <div id="wrap-next-slide" class="slides">
-                       <iframe src="../../index.html" width="640" height="512" id="next-slide"></iframe>
+                       <iframe width="640" height="512" id="next-slide"></iframe>
                        <span>UPCOMING:</span>
                </div>
                <div id="notes"></div>
                <script>
                        window.addEventListener( 'load', function() {
 
+                               // ASEEMK: fix for calling talk may not be at index.html.
+                               var iframes = document.querySelectorAll( '.slides iframe' );
+                               [].slice.call(iframes).forEach(function (iframe) {
+                                       console.log(window.opener);
+                                       iframe.src = window.opener ? window.opener.location.href : '/';
+                               });
+
                                (function( window, undefined ) {
                                        var notes = document.getElementById( 'notes' ),
                                                currentSlide = document.getElementById( 'current-slide' ),