return texts;
};
+// Convert to a normal space
+Util.nbspToSpace = function(str) {
+ var re = new RegExp(String.fromCharCode(160), 'g');
+ return str.replace(re, ' ');
+};
+
Util.getLegend = function(parent) {
parent = parent || document;
var legend = parent.getElementsByClassName("dygraph-legend")[0];
- var re = new RegExp(String.fromCharCode(160), 'g');
- return legend.textContent.replace(re, ' ');
+ return Util.nbspToSpace(legend.textContent);
};
/**
*/
Util.assertStyleOfChildren = function(selector, property, expectedValue) {
assert.isTrue(selector.length > 0);
- $.each(selector, function(idx, child) {
- assert.isEqual(expectedValue, $(child).css(property));
- });
+ for (var idx = 0; idx < selector.length; idx++) {
+ var child = selector[idx];
+ assert.equal(expectedValue, window.getComputedStyle(child)[property]);
+ }
};