broadcasting fragments state in multiplex plugin (#394)
This commit is contained in:
27
js/reveal.js
27
js/reveal.js
@ -645,6 +645,13 @@ var Reveal = (function(){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns last element of an array
|
||||
*/
|
||||
function lastElem(array) {
|
||||
return array.slice(-1)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies JavaScript-controlled layout rules to the
|
||||
* presentation.
|
||||
@ -2045,6 +2052,26 @@ var Reveal = (function(){
|
||||
return config;
|
||||
},
|
||||
|
||||
// Returns an index (1-based) of the current fragment
|
||||
getCurrentFragmentIndex : function() {
|
||||
var visibleFragments;
|
||||
|
||||
// vertical slides:
|
||||
if( document.querySelector( VERTICAL_SLIDES_SELECTOR + '.present' ) ) {
|
||||
visibleFragments = document.querySelectorAll( VERTICAL_SLIDES_SELECTOR + '.present .fragment.visible' );
|
||||
}
|
||||
// Horizontal slides:
|
||||
else {
|
||||
visibleFragments = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.present .fragment.visible' );
|
||||
}
|
||||
|
||||
if( visibleFragments.length) {
|
||||
return visibleFragments.length;
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
|
||||
// Helper method, retrieves query string as a key/value hash
|
||||
getQueryHash: function() {
|
||||
var query = {};
|
||||
|
4
js/reveal.min.js
vendored
4
js/reveal.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user