From c3415028b07dea13c746714ef3c3aa9bfff466a2 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 10 Aug 2017 20:45:42 +1000 Subject: [PATCH] mathjax and fade improvements - remove the unnecessary processing delays mathjax defaults to - use a separate fade time for question and answer --- web/mathjax/conf.js | 7 ++++++- web/reviewer.js | 10 ++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/web/mathjax/conf.js b/web/mathjax/conf.js index d8f0c7a03..7bed3c279 100644 --- a/web/mathjax/conf.js +++ b/web/mathjax/conf.js @@ -6,5 +6,10 @@ window.MathJax = { }, messageStyle: "none", skipStartupTypeset: true, - showMathMenu: false + showMathMenu: false, + AuthorInit: function () { + MathJax.Hub.processSectionDelay = 0; + MathJax.Hub.processUpdateTime = 0; + MathJax.Hub.processUpdateDelay = 0; + } }; diff --git a/web/reviewer.js b/web/reviewer.js index 7871edca3..57417fb4e 100644 --- a/web/reviewer.js +++ b/web/reviewer.js @@ -1,8 +1,10 @@ var ankiPlatform = "desktop"; var typeans; -var fadeTime = 100; -function _updateQA(html, onupdate, onshown) { +var qFade = 100; +var aFade = 0; + +function _updateQA(html, fadeTime, onupdate, onshown) { // fade out current text var qa = $("#qa"); qa.fadeTo(fadeTime, 0, function() { @@ -27,7 +29,7 @@ function _updateQA(html, onupdate, onshown) { } function _showQuestion(q, bodyclass) { - _updateQA(q, function(obj) { + _updateQA(q, qFade, function(obj) { // return to top of window window.scrollTo(0, 0); @@ -42,7 +44,7 @@ function _showQuestion(q, bodyclass) { } function _showAnswer(a, bodyclass) { - _updateQA(a, function(obj) { + _updateQA(a, aFade, function(obj) { if (bodyclass) { // when previewing document.body.className = bodyclass;