Fix 'dirty' indicator on 'Code' boxes
Toggle a class on the container instead of changing label text.
This commit is contained in:
parent
eb9cc20d58
commit
8140e16474
|
@ -67,6 +67,10 @@
|
|||
#sections > div:not(:first-child) {
|
||||
border-top: 2px solid black;
|
||||
}
|
||||
.dirty > label::before {
|
||||
content: "*";
|
||||
font-weight: bold;
|
||||
}
|
||||
#basic-info label {
|
||||
display: inline-block;
|
||||
width: 10em;
|
||||
|
|
5
edit.js
5
edit.js
|
@ -85,10 +85,7 @@ function indicateCodeChange(cm) {
|
|||
var clean = cm.isClean(cm.lastChange);
|
||||
if (clean != cm.lastClean) {
|
||||
cm.lastClean = clean;
|
||||
var label = cm.getTextArea().previousElementSibling;
|
||||
if (label) {
|
||||
label.textContent = label.textContent.replace(/\*?$/, clean ? '' : '*');
|
||||
}
|
||||
cm.getTextArea().parentNode.classList[clean ? "remove" : "add"]("dirty");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user