fix highlight css selection

This commit is contained in:
Gambhiro 2017-01-14 08:46:01 +00:00
parent a1375b17e0
commit ae09aabeb5
2 changed files with 6 additions and 4 deletions

View File

@ -17,6 +17,8 @@
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'> <link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/font-awesome.min.css"> <link rel="stylesheet" href="css/font-awesome.min.css">
<!-- TODO Loading both only works b/c book.js disables one of these with .prop(), selecting one by its href. It would make more sense to put the different styles under a class ("highlight-light" / "highlight-dark") and add or remove that class on the <body> or #page-wrapper. -->
<link rel="stylesheet" href="css/highlight.css"> <link rel="stylesheet" href="css/highlight.css">
<link rel="stylesheet" href="css/tomorrow-night.css"> <link rel="stylesheet" href="css/tomorrow-night.css">

View File

@ -131,11 +131,11 @@ $( document ).ready(function() {
function set_theme(theme) { function set_theme(theme) {
if (theme == 'coal' || theme == 'navy') { if (theme == 'coal' || theme == 'navy') {
$("[href='tomorrow-night.css']").prop('disabled', false); $("[href='css/tomorrow-night.css']").prop('disabled', false);
$("[href='highlight.css']").prop('disabled', true); $("[href='css/highlight.css']").prop('disabled', true);
} else { } else {
$("[href='tomorrow-night.css']").prop('disabled', true); $("[href='css/tomorrow-night.css']").prop('disabled', true);
$("[href='highlight.css']").prop('disabled', false); $("[href='css/highlight.css']").prop('disabled', false);
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);