tweaks to showSlideNumber config #1833
This commit is contained in:
parent
8f7e4bfd41
commit
b143e5976b
@ -767,10 +767,11 @@ Reveal.configure({ slideNumber: true });
|
||||
// "c/t": flattened slide number / total slides
|
||||
Reveal.configure({ slideNumber: 'c/t' });
|
||||
|
||||
// Control which views the slide number displays on using the "showSlideNumber" value.
|
||||
// "all": show on all views (default)
|
||||
// "notes": only show slide numbers on speaker notes view
|
||||
Reveal.configure({ showSlideNumber: 'notes' });
|
||||
// Control which views the slide number displays on using the "showSlideNumber" value:
|
||||
// "all": show on all views (default)
|
||||
// "speaker": only show slide numbers on speaker notes view
|
||||
// "print": only show slide numbers when printing to PDF
|
||||
Reveal.configure({ showSlideNumber: 'speaker' });
|
||||
|
||||
```
|
||||
|
||||
|
27
js/reveal.js
27
js/reveal.js
@ -701,7 +701,7 @@
|
||||
}
|
||||
|
||||
// Inject slide numbers if `slideNumbers` are enabled
|
||||
if( config.slideNumber ) {
|
||||
if( config.slideNumber && /all|print/i.test( config.showSlideNumber ) ) {
|
||||
var slideNumberH = parseInt( slide.getAttribute( 'data-index-h' ), 10 ) + 1,
|
||||
slideNumberV = parseInt( slide.getAttribute( 'data-index-v' ), 10 ) + 1;
|
||||
|
||||
@ -985,18 +985,6 @@
|
||||
dom.controls.style.display = config.controls ? 'block' : 'none';
|
||||
dom.progress.style.display = config.progress ? 'block' : 'none';
|
||||
|
||||
var slideNumberDisplay = 'none';
|
||||
if (config.slideNumber && !isPrintingPDF()) {
|
||||
if (config.showSlideNumber === 'all') {
|
||||
slideNumberDisplay = 'block';
|
||||
}
|
||||
else if (config.showSlideNumber === 'notes' && isSpeakerNotes()) {
|
||||
slideNumberDisplay = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
dom.slideNumber.style.display = slideNumberDisplay;
|
||||
|
||||
if( config.shuffle ) {
|
||||
shuffle();
|
||||
}
|
||||
@ -1079,6 +1067,19 @@
|
||||
} );
|
||||
}
|
||||
|
||||
// Slide numbers
|
||||
var slideNumberDisplay = 'none';
|
||||
if( config.slideNumber && !isPrintingPDF() ) {
|
||||
if( config.showSlideNumber === 'all' ) {
|
||||
slideNumberDisplay = 'block';
|
||||
}
|
||||
else if( config.showSlideNumber === 'speaker' && isSpeakerNotes() ) {
|
||||
slideNumberDisplay = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
dom.slideNumber.style.display = slideNumberDisplay;
|
||||
|
||||
sync();
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user