Correction of previous fix for setting slide numbers in footers

This commit is contained in:
robbie jackson 2021-11-26 22:08:03 +00:00 committed by Raoul Snyman
parent 59f625bd8f
commit 8e1ff6e0d6

View File

@ -295,7 +295,7 @@ var Display = {
let doItemTransitions = options.doItemTransitions || false; let doItemTransitions = options.doItemTransitions || false;
let hideMouse = options.hideMouse || false; let hideMouse = options.hideMouse || false;
if (options.slideNumbersInFooter) { if (options.slideNumbersInFooter) {
Display._revealConfig.slideNumber = "c/t"; Display._revealConfig.slideNumber = Display.setFooterSlideNumbers;
} }
// Now continue to initialisation // Now continue to initialisation
@ -1163,6 +1163,22 @@ var Display = {
"left: -999999px" "left: -999999px"
].join(" !important;"); ].join(" !important;");
document.body.appendChild(Display._fontContainer); document.body.appendChild(Display._fontContainer);
},
/**
* Prepare the slide number (slide x/y) for insertion into the Reveal footer
* This is a callback function which Reveal calls to get the values
* Fixes https://gitlab.com/openlp/openlp/-/issues/942
*/
setFooterSlideNumbers: function (slide) {
let value = ['', '', ''];
// Reveal does call this function passing undefined
if (typeof slide === 'undefined') {
return value;
}
value[0] = Reveal.getSlidePastCount(slide) + 1;
value[1] = '/';
value[2] = Object.keys(Display._slides).length;
return value;
} }
}; };
new QWebChannel(qt.webChannelTransport, function (channel) { new QWebChannel(qt.webChannelTransport, function (channel) {