Skip to content

Commit

Permalink
Check for whether MathJax is already loaded before using MathJax vari…
Browse files Browse the repository at this point in the history
…able for AuthorConfig. Resolves issue #671.
  • Loading branch information
dpvc committed Nov 19, 2013
1 parent 62a267e commit 62cdfcf
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions unpacked/MathJax.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,26 @@
* limitations under the License.
*/

if (window.MathJax) {window.MathJax = {AuthorConfig: window.MathJax}} else {window.MathJax = {}}

// MathJax.isPacked = true; // This line is uncommented by the packer.

//
// Check if browser can support MathJax (no one fails this nowadays)
//
if (document.getElementById && document.childNodes && document.createElement) {

if (!MathJax.Hub) { // skip if already loaded
//
// Skip if MathJax is already loaded
//
if (!(window.MathJax && MathJax.Hub)) {

//
// Get author configuration from MathJax variable, if any
//
if (window.MathJax) {window.MathJax = {AuthorConfig: window.MathJax}}
else {window.MathJax = {}}

// MathJax.isPacked = true; // This line is uncommented by the packer.

MathJax.version = "2.3";
MathJax.fileversion = "2.3";
MathJax.fileversion = "2.3.1";

/**********************************************************/

Expand Down

0 comments on commit 62cdfcf

Please sign in to comment.