diff --git a/common/lib/xmodule/xmodule/js/src/graphical_slider_tool/graph.js b/common/lib/xmodule/xmodule/js/src/graphical_slider_tool/graph.js index 79148d144e..656ff82690 100644 --- a/common/lib/xmodule/xmodule/js/src/graphical_slider_tool/graph.js +++ b/common/lib/xmodule/xmodule/js/src/graphical_slider_tool/graph.js @@ -105,7 +105,8 @@ define('Graph', ['logme'], function (logme) { } function processMovingLabel(obj) { - var labelText, funcString, disableAutoReturn, paramNames, func; + var labelText, funcString, disableAutoReturn, paramNames, func, + fontWeight, fontColor; if (obj.hasOwnProperty('@text') === false) { logme('ERROR: You did not define a "text" attribute for the moving_label.'); @@ -131,6 +132,29 @@ define('Graph', ['logme'], function (logme) { } funcString = obj['#text']; + fontColor = 'black'; + if ( + (obj.hasOwnProperty('@color') === true) && + (typeof obj['@color'] === 'string') + ) { + fontColor = obj['@color']; + } + + fontWeight = 'normal'; + if ( + (obj.hasOwnProperty('@weight') === true) && + (typeof obj['@weight'] === 'string') + ) { + if ( + (obj['@weight'].toLowerCase() === 'normal') || + (obj['@weight'].toLowerCase() === 'bold') + ) { + fontWeight = obj['@weight']; + } else { + logme('ERROR: Moving label can have a weight property of "normal" or "bold".'); + } + } + disableAutoReturn = obj['@disable_auto_return']; funcString = $('