From 8ce8e51e728a3ffec1b6f8464b4ef5a6eed38b02 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Fri, 3 May 2013 18:45:58 -0400 Subject: [PATCH] Use a count rather than a boolean in checking for a localization restart with the message system so that if multiple typesetting messages (or other messages that reuse their id number) are issued before the localization is loaded, we don't lose the clears. --- unpacked/MathJax.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index 5f6b33c69..bf4e7bb4c 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -1586,7 +1586,11 @@ MathJax.Message = { } catch (err) { if (!err.restart) {throw err} if (!err.restart.called) { - this.log[n].restarted = true; // mark it so we can tell if the Clear() comes before the message is up + // + // Mark it so we can tell if the Clear() comes before the message is displayed + // + if (this.log[n].restarted == null) {this.log[n].restarted = 0} + this.log[n].restarted++; delete this.log[n].cleared; MathJax.Callback.After(["Set",this,text,n,clearDelay],err.restart); return n; } @@ -1628,7 +1632,7 @@ MathJax.Message = { // if (this.log[n].restarted) { if (this.log[n].cleared) {clearDelay = 0} - delete this.log[n].restarted, this.log[n].cleared; + if (--this.log[n].restarted === 0) {delete this.log[n].cleared} } // // Check if we need to clear the message automatically.