summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/read.js8
-rw-r--r--read.html16
2 files changed, 12 insertions, 12 deletions
diff --git a/js/read.js b/js/read.js
index 8b38277..f56df46 100644
--- a/js/read.js
+++ b/js/read.js
@@ -225,14 +225,6 @@ function search() {
}
}
-function toggle_transitions(elem) {
- localforage.setItem("epube.disable-transitions", elem.checked);
-}
-
-function toggle_swipes(elem) {
- localforage.setItem("epube.disable-swipes", elem.checked);
-}
-
function dict_lookup(word, callback) {
$.post("backend.php", {op: 'define', word: word}, function(data) {
if (data) {
diff --git a/read.html b/read.html
index 327a179..0c09b88 100644
--- a/read.html
+++ b/read.html
@@ -65,13 +65,13 @@
<div class="checkbox">
<label>
- <input class="transition_checkbox" onchange="toggle_transitions(this)"
+ <input class="transition_checkbox"
type="checkbox"> Disable transitions
</label>
</div>
<div class="checkbox">
<label>
- <input class="swipe_checkbox" onchange="toggle_swipes(this)"
+ <input class="swipe_checkbox"
type="checkbox"> Disable swipes
</label>
</div>
@@ -432,11 +432,19 @@
});
localforage.getItem("epube.disable-transitions").then(function(disable) {
- $(".transition_checkbox").attr("checked", disable);
+ $(".transition_checkbox")
+ .attr("checked", disable)
+ .on("click", function() {
+ localforage.setItem("epube.disable-transitions", this.checked);
+ });
});
localforage.getItem("epube.disable-swipes").then(function(disable) {
- $(".swipe_checkbox").attr("checked", disable);
+ $(".swipe_checkbox")
+ .attr("checked", disable)
+ .on("click", function() {
+ localforage.setItem("epube.disable-swipes", this.checked);
+ });
});
localforage.getItem("epube.fontFamily").then(function(font) {