Commit d3122936 by David Ormsbee

Merge pull request #1348 from MITx/fix/zoldak/ie-keyword

Fix broken IE due to using the word function
parents acfafa65 896933a3
...@@ -8,13 +8,13 @@ define('ElOutput', ['logme'], function (logme) { ...@@ -8,13 +8,13 @@ define('ElOutput', ['logme'], function (logme) {
function ElOutput(config, state) { function ElOutput(config, state) {
if ($.isPlainObject(config.functions.function)) { if ($.isPlainObject(config.functions["function"])) {
processFuncObj(config.functions.function); processFuncObj(config.functions["function"]);
} else if ($.isArray(config.functions.function)) { } else if ($.isArray(config.functions["function"])) {
(function (c1) { (function (c1) {
while (c1 < config.functions.function.length) { while (c1 < config.functions["function"].length) {
if ($.isPlainObject(config.functions.function[c1])) { if ($.isPlainObject(config.functions["function"][c1])) {
processFuncObj(config.functions.function[c1]); processFuncObj(config.functions["function"][c1]);
} }
c1 += 1; c1 += 1;
......
...@@ -6,13 +6,13 @@ define('GLabelElOutput', ['logme'], function (logme) { ...@@ -6,13 +6,13 @@ define('GLabelElOutput', ['logme'], function (logme) {
return GLabelElOutput; return GLabelElOutput;
function GLabelElOutput(config, state) { function GLabelElOutput(config, state) {
if ($.isPlainObject(config.functions.function)) { if ($.isPlainObject(config.functions["function"])) {
processFuncObj(config.functions.function); processFuncObj(config.functions["function"]);
} else if ($.isArray(config.functions.function)) { } else if ($.isArray(config.functions["function"])) {
(function (c1) { (function (c1) {
while (c1 < config.functions.function.length) { while (c1 < config.functions["function"].length) {
if ($.isPlainObject(config.functions.function[c1])) { if ($.isPlainObject(config.functions["function"][c1])) {
processFuncObj(config.functions.function[c1]); processFuncObj(config.functions["function"][c1]);
} }
c1 += 1; c1 += 1;
......
...@@ -838,33 +838,33 @@ define('Graph', ['logme'], function (logme) { ...@@ -838,33 +838,33 @@ define('Graph', ['logme'], function (logme) {
return; return;
} }
if (typeof config.functions.function === 'string') { if (typeof config.functions["function"] === 'string') {
// If just one function string is present. // If just one function string is present.
addFunction(config.functions.function); addFunction(config.functions["function"]);
} else if ($.isPlainObject(config.functions.function) === true) { } else if ($.isPlainObject(config.functions["function"]) === true) {
// If a function is present, but it also has properties // If a function is present, but it also has properties
// defined. // defined.
callAddFunction(config.functions.function); callAddFunction(config.functions["function"]);
} else if ($.isArray(config.functions.function)) { } else if ($.isArray(config.functions["function"])) {
// If more than one function is defined. // If more than one function is defined.
for (c1 = 0; c1 < config.functions.function.length; c1 += 1) { for (c1 = 0; c1 < config.functions["function"].length; c1 += 1) {
// For each definition, we must check if it is a simple // For each definition, we must check if it is a simple
// string definition, or a complex one with properties. // string definition, or a complex one with properties.
if (typeof config.functions.function[c1] === 'string') { if (typeof config.functions["function"][c1] === 'string') {
// Simple string. // Simple string.
addFunction(config.functions.function[c1]); addFunction(config.functions["function"][c1]);
} else if ($.isPlainObject(config.functions.function[c1])) { } else if ($.isPlainObject(config.functions["function"][c1])) {
// Properties are present. // Properties are present.
callAddFunction(config.functions.function[c1]); callAddFunction(config.functions["function"][c1]);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment