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.

This commit is contained in:
Davide P. Cervone 2013-05-03 18:45:58 -04:00
parent 3ce040bb60
commit 8ce8e51e72

View File

@ -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.