diff options
author | Andrew Dolgov <[email protected]> | 2018-01-25 18:25:36 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2018-01-25 18:25:36 +0300 |
commit | f11c22169f9468ddb2dcdfa51da7327d91d35396 (patch) | |
tree | 30abd11e93817ba06e415e3ae35013c245cc47e4 | |
parent | f76c411e47f07c8f00327996c66e652c664678d2 (diff) |
remove two needless functions
-rw-r--r-- | js/read.js | 8 | ||||
-rw-r--r-- | read.html | 16 |
2 files changed, 12 insertions, 12 deletions
@@ -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) { @@ -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) { |