prevent linked slide numbers from changing color

edit
Hakim El Hattab 2018-04-16 09:48:37 +02:00
parent f713d9d67d
commit 531d1e8791
3 changed files with 37 additions and 29 deletions

View File

@ -460,6 +460,9 @@ body {
background-color: rgba(0, 0, 0, 0.4); background-color: rgba(0, 0, 0, 0.4);
padding: 5px; } padding: 5px; }
.reveal .slide-number a {
color: currentColor; }
.reveal .slide-number-delimiter { .reveal .slide-number-delimiter {
margin: 0 3px; } margin: 0 3px; }

View File

@ -553,6 +553,10 @@ $controlsArrowAngleActive: 36deg;
padding: 5px; padding: 5px;
} }
.reveal .slide-number a {
color: currentColor;
}
.reveal .slide-number-delimiter { .reveal .slide-number-delimiter {
margin: 0 3px; margin: 0 3px;
} }

View File

@ -2259,35 +2259,35 @@
/** /**
* Return a hash URL that will resolve to the current slide location. * Return a hash URL that will resolve to the current slide location.
*/ */
function locationHash() { function locationHash() {
var url = '/'; var url = '/';
// Attempt to create a named link based on the slide's ID // Attempt to create a named link based on the slide's ID
var id = currentSlide ? currentSlide.getAttribute( 'id' ) : null; var id = currentSlide ? currentSlide.getAttribute( 'id' ) : null;
if( id ) { if( id ) {
id = encodeURIComponent( id ); id = encodeURIComponent( id );
} }
var indexf; var indexf;
if( config.fragmentInURL ) { if( config.fragmentInURL ) {
indexf = getIndices().f; indexf = getIndices().f;
} }
// If the current slide has an ID, use that as a named link, // If the current slide has an ID, use that as a named link,
// but we don't support named links with a fragment index // but we don't support named links with a fragment index
if( typeof id === 'string' && id.length && indexf === undefined ) { if( typeof id === 'string' && id.length && indexf === undefined ) {
url = '/' + id; url = '/' + id;
} }
// Otherwise use the /h/v index // Otherwise use the /h/v index
else { else {
if( indexh > 0 || indexv > 0 || indexf !== undefined ) url += indexh + config.hashOneBasedIndex; if( indexh > 0 || indexv > 0 || indexf !== undefined ) url += indexh + config.hashOneBasedIndex;
if( indexv > 0 || indexf !== undefined ) url += '/' + (indexv + config.hashOneBasedIndex); if( indexv > 0 || indexf !== undefined ) url += '/' + (indexv + config.hashOneBasedIndex);
if( indexf !== undefined ) url += '/' + indexf; if( indexf !== undefined ) url += '/' + indexf;
} }
return url;
return url;
} }
/** /**
@ -3009,6 +3009,7 @@
* @return {string} HTML string fragment * @return {string} HTML string fragment
*/ */
function formatSlideNumber( a, delimiter, b ) { function formatSlideNumber( a, delimiter, b ) {
var url = '#' + locationHash(); var url = '#' + locationHash();
if( typeof b === 'number' && !isNaN( b ) ) { if( typeof b === 'number' && !isNaN( b ) ) {
return '<a href="' + url + '">' + return '<a href="' + url + '">' +
@ -3839,10 +3840,10 @@
} }
else { else {
// Read the index components of the hash // Read the index components of the hash
var h = parseInt( bits[0], 10 ) || 0 - config.hashOneBasedIndex, var h = parseInt( bits[0], 10 ) || 0 - config.hashOneBasedIndex,
v = parseInt( bits[1], 10 ) || 0 - config.hashOneBasedIndex, v = parseInt( bits[1], 10 ) || 0 - config.hashOneBasedIndex,
f; f;
if( config.fragmentInURL ) { if( config.fragmentInURL ) {
f = parseInt( bits[2], 10 ); f = parseInt( bits[2], 10 );
if( isNaN( f ) ) { if( isNaN( f ) ) {