I didn't know about HTMLStyleElement.disabled :(
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Fri, 23 Sep 2011 12:17:35 -0600
changeset 626 963926c4a021
parent 625 6bd5bb0fdb9a
child 627 f6a356eb9f31
I didn't know about HTMLStyleElement.disabled :(
tests.js
--- a/tests.js	Thu Sep 22 15:21:27 2011 -0600
+++ b/tests.js	Fri Sep 23 12:17:35 2011 -0600
@@ -45,12 +45,7 @@
 	function updateAlertRowStyle() {
 	//@{
 		var checked = document.querySelector("#alert-checkbox").checked;
-		var style = document.querySelector("#alerts");
-		if (checked && !/^\/\*/.test(style.textContent)) {
-			style.textContent = "/* " + style.textContent + " */";
-		} else if (!checked) {
-			style.textContent = style.textContent.replace(/(\/\* | \*\/)/g, "");
-		}
+		document.querySelector("#alerts").disabled = checked;
 		localStorage["display-alerts"] = checked;
 	}
 	//@}