Renaming key within fragmentData
authorMichael Kühnel <mail@michael-kuehnel.de>
Thu, 18 Oct 2012 22:12:53 +0000 (00:12 +0200)
committerMichael Kühnel <mail@michael-kuehnel.de>
Thu, 18 Oct 2012 22:12:53 +0000 (00:12 +0200)
Might be better to use one variable with different values.

plugin/speakernotes/client.js
plugin/speakernotes/notes.html

index 757e6cdff88b182eac403c7b1d82baef27861db1..156cb9a8886a5ad589c780ebde5db5375e8f5580 100644 (file)
@@ -11,7 +11,7 @@
        // Fires when a fragment is shown
        Reveal.addEventListener( 'fragmentshown', function( event ) {
                var fragmentData = {
-                       showFragment : true,
+                       fragment : 'next',
                        socketId : socketId
                };
                socket.emit('fragmentchanged', fragmentData);
@@ -20,7 +20,7 @@
        // Fires when a fragment is hidden
        Reveal.addEventListener( 'fragmenthidden', function( event ) {
                var fragmentData = {
-                       hideFragment : true,
+                       fragment : 'previous',
                        socketId : socketId
                };
                socket.emit('fragmentchanged', fragmentData);
index af42480cbdf0898d0ba6ca8f45b3cf94cc10aa91..f3b610d1a529e145ff6377404de6ab3be22b2aea 100644 (file)
                        console.dir(data);
                        if (data.socketId !== socketId) { return; }
 
-                       if (data.showFragment === true) {
+                       if (data.fragment === 'next') {
                                currentSlide.contentWindow.Reveal.nextFragment();
                        }
-                       else if (data.hideFragment === true) {
+                       else if (data.fragment === 'previous') {
                                currentSlide.contentWindow.Reveal.previousFragment();
                        }
                });