Fixed the checkbox

There, now everything should work. It's not ideal though, I need to figure out how to shorten it.
This commit is contained in:
Jaroslav Petrnoušek 2014-10-03 23:04:04 +02:00
parent 9574adeaeb
commit 1705ab3327

View File

@ -34,11 +34,13 @@ function createStyleElement(style) {
editLink.setAttribute("href", editLink.getAttribute("href") + style.id);
editLink.addEventListener("click", openLink, false);
if (checkbox.checked == true) {
(checkbox, styleName).addEventListener("click", function() { enable(event, false); }, false);
if (checkbox.checked) {
styleName.addEventListener("click", function() { enable(event, false); }, false);
checkbox.addEventListener("click", function() { enable(event, false); }, false);
}
else {
(checkbox, styleName).addEventListener("click", function() { enable(event, true); }, false);
styleName.addEventListener("click", function() { enable(event, true); }, false);
checkbox.addEventListener("click", function() { enable(event, true); }, false);
}
e.querySelector(".delete").addEventListener("click", function() { doDelete(event, false); }, false);
return e;