Renaming key within fragmentData
Might be better to use one variable with different values.edit
parent
d02e64adbd
commit
82bd8e4fb0
|
@ -11,7 +11,7 @@
|
||||||
// Fires when a fragment is shown
|
// Fires when a fragment is shown
|
||||||
Reveal.addEventListener( 'fragmentshown', function( event ) {
|
Reveal.addEventListener( 'fragmentshown', function( event ) {
|
||||||
var fragmentData = {
|
var fragmentData = {
|
||||||
showFragment : true,
|
fragment : 'next',
|
||||||
socketId : socketId
|
socketId : socketId
|
||||||
};
|
};
|
||||||
socket.emit('fragmentchanged', fragmentData);
|
socket.emit('fragmentchanged', fragmentData);
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
// Fires when a fragment is hidden
|
// Fires when a fragment is hidden
|
||||||
Reveal.addEventListener( 'fragmenthidden', function( event ) {
|
Reveal.addEventListener( 'fragmenthidden', function( event ) {
|
||||||
var fragmentData = {
|
var fragmentData = {
|
||||||
hideFragment : true,
|
fragment : 'previous',
|
||||||
socketId : socketId
|
socketId : socketId
|
||||||
};
|
};
|
||||||
socket.emit('fragmentchanged', fragmentData);
|
socket.emit('fragmentchanged', fragmentData);
|
||||||
|
|
|
@ -128,10 +128,10 @@
|
||||||
console.dir(data);
|
console.dir(data);
|
||||||
if (data.socketId !== socketId) { return; }
|
if (data.socketId !== socketId) { return; }
|
||||||
|
|
||||||
if (data.showFragment === true) {
|
if (data.fragment === 'next') {
|
||||||
currentSlide.contentWindow.Reveal.nextFragment();
|
currentSlide.contentWindow.Reveal.nextFragment();
|
||||||
}
|
}
|
||||||
else if (data.hideFragment === true) {
|
else if (data.fragment === 'previous') {
|
||||||
currentSlide.contentWindow.Reveal.previousFragment();
|
currentSlide.contentWindow.Reveal.previousFragment();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue