Przeglądaj źródła

Renaming key within fragmentData

Might be better to use one variable with different values.
Michael Kühnel 12 lat temu
rodzic
commit
82bd8e4fb0
2 zmienionych plików z 4 dodań i 4 usunięć
  1. 2 2
      plugin/speakernotes/client.js
  2. 2 2
      plugin/speakernotes/notes.html

+ 2 - 2
plugin/speakernotes/client.js

@@ -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);

+ 2 - 2
plugin/speakernotes/notes.html

@@ -128,10 +128,10 @@
 			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();
 			}
 		});