Commits

James Sumners  committed 8c53095

Fixed a bug where Firefox was not updating the table as it should.

  • Participants
  • Parent commits f62ab98

Comments (0)

Files changed (1)

 
 	calc = function() {
 		var hzTable = freqcalc.noteLengthToHz(bpmInput.value, '0'),
-			outputTable = _('#output');
+			outputTable = _('#output'),
+			setText = function(){};
 
 		if (!hzTable) {
 			throw new Error('Unexpected output.');
 		}
 
+		setText = function(ele, text) {
+			if (ele.innerText) {
+				ele.innerText = text;
+			} else if (ele.textContent) {
+				// Why does Firefox have this silly property and not innerText?
+				ele.textContent = text;
+			}
+		};
+
 		for (var prop in hzTable) {
 			if (hzTable.hasOwnProperty(prop)) {
-				outputElements[prop].innerText = hzTable[prop].toString().substr(0,4);
+				setText(outputElements[prop],
+					hzTable[prop].toString().substr(0,4));
 			}
 		}
 	};