Fix 'dirty' indicator on 'Code' boxes

Toggle a class on the container instead of changing label text.
This commit is contained in:
hideheader 2015-03-10 11:45:13 -04:00
parent eb9cc20d58
commit 8140e16474
2 changed files with 5 additions and 4 deletions

View File

@ -67,6 +67,10 @@
#sections > div:not(:first-child) { #sections > div:not(:first-child) {
border-top: 2px solid black; border-top: 2px solid black;
} }
.dirty > label::before {
content: "*";
font-weight: bold;
}
#basic-info label { #basic-info label {
display: inline-block; display: inline-block;
width: 10em; width: 10em;

View File

@ -85,10 +85,7 @@ function indicateCodeChange(cm) {
var clean = cm.isClean(cm.lastChange); var clean = cm.isClean(cm.lastChange);
if (clean != cm.lastClean) { if (clean != cm.lastClean) {
cm.lastClean = clean; cm.lastClean = clean;
var label = cm.getTextArea().previousElementSibling; cm.getTextArea().parentNode.classList[clean ? "remove" : "add"]("dirty");
if (label) {
label.textContent = label.textContent.replace(/\*?$/, clean ? '' : '*');
}
} }
}; };