Add a button to toggle visible whitespace for now. Not yet persisted.
This commit is contained in:
@ -1662,6 +1662,29 @@ async function sourcePretty() {
|
||||
}
|
||||
}
|
||||
|
||||
function toggleVisibleWhitespace() {
|
||||
let editor_style = document.getElementById('editor_style');
|
||||
/*
|
||||
* There is likely a better way to do this, but stomping on the CSS was
|
||||
* the easiest to wrangle at the time.
|
||||
*/
|
||||
if (editor_style.innerHTML.length) {
|
||||
editor_style.innerHTML = '';
|
||||
} else {
|
||||
editor_style.innerHTML = css`
|
||||
.cm-trailingSpace {
|
||||
background-color: unset !important;
|
||||
}
|
||||
.cm-highlightTab {
|
||||
background-image: unset !important;
|
||||
}
|
||||
.cm-highlightSpace:before {
|
||||
content: unset !important;
|
||||
}
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
// TODOC
|
||||
window.addEventListener('load', function () {
|
||||
window.addEventListener('hashchange', hashChange);
|
||||
@ -1687,6 +1710,9 @@ window.addEventListener('load', function () {
|
||||
document
|
||||
.getElementById('pretty')
|
||||
.addEventListener('click', () => sourcePretty());
|
||||
document
|
||||
.getElementById('whitespace')
|
||||
.addEventListener('click', () => toggleVisibleWhitespace());
|
||||
document
|
||||
.getElementById('trace_button')
|
||||
.addEventListener('click', function (event) {
|
||||
|
Reference in New Issue
Block a user