Skip to content

Commit a2e831d

Browse files
authored
Merge pull request #93 from CodeWithGroup/feature/retain-font
Retain OpenDyslexic settings between page refreshes
2 parents 044d10e + 72e8a46 commit a2e831d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

js/change-font.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
"use strict"
22

3-
$(function() {
3+
$(function () {
4+
$(document).ready(function () {
5+
if (localStorage.getItem("CodeWithOpenDyslexic") === "1") {
6+
$('body').toggleClass('open-dyslexic');
7+
}
8+
});
9+
410
$('#change-font').click(function () {
11+
if (localStorage.getItem("CodeWithOpenDyslexic") === "1") {
12+
localStorage.setItem("CodeWithOpenDyslexic", 0);
13+
} else {
14+
localStorage.setItem("CodeWithOpenDyslexic", 1);
15+
}
16+
517
$('body').toggleClass('open-dyslexic');
618
});
719
})

0 commit comments

Comments
 (0)