Fixed wordwrap and marking

This commit is contained in:
Martin Mahner 2017-09-06 13:52:52 +02:00
parent 4bdcbdcd20
commit f08c7de609
3 changed files with 7 additions and 6 deletions

View file

@ -59,7 +59,8 @@
$codeColor: #f8f8f2;
$codeLineColor: #aaa;
$codeBackgroundColor: #232829;
$markerColor: #f4e009;
$markerColor: rgb(244,244,9);
$markerBackgroundColor: rgba(244,244,9,.2);
.snippet-code {
@ -71,7 +72,7 @@ $markerColor: #f4e009;
line-height: 1.1rem;
padding: 1rem 0;
.wordwrap {
&.wordwrap {
overflow: auto;
white-space: nowrap;
}
@ -85,7 +86,7 @@ $markerColor: #f4e009;
&.marked {
color: $markerColor;
background-color: $markerColor;
background-color: $markerBackgroundColor;
}
}

File diff suppressed because one or more lines are too long

View file

@ -98,12 +98,12 @@
}
}
let lines = document.querySelectorAll('.code li');
let lines = document.querySelectorAll('.snippet-code li');
lines.forEach(function(el){
el.onclick = function(e) {
el.classList.toggle('marked');
let hash = 'L';
let marked = document.querySelectorAll('.code li.marked');
let marked = document.querySelectorAll('.snippet-code li.marked');
marked.forEach(function(line){
if (hash !== 'L')
hash += ',';