make editor fully clean on saving
This commit is contained in:
parent
9e11435923
commit
001db9a19f
10
edit/edit.js
10
edit/edit.js
|
@ -319,6 +319,7 @@ function isCleanGlobal() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function setCleanGlobal() {
|
function setCleanGlobal() {
|
||||||
|
setCleanItem($('#sections'), true);
|
||||||
$$('#header, #sections > div').forEach(setCleanSection);
|
$$('#header, #sections > div').forEach(setCleanSection);
|
||||||
// forget the dirty applies-to ids from a deleted section after the style was saved
|
// forget the dirty applies-to ids from a deleted section after the style was saved
|
||||||
dirty = {};
|
dirty = {};
|
||||||
|
@ -326,13 +327,8 @@ function setCleanGlobal() {
|
||||||
|
|
||||||
function setCleanSection(section) {
|
function setCleanSection(section) {
|
||||||
$$('.style-contributor', section).forEach(node => setCleanItem(node, true));
|
$$('.style-contributor', section).forEach(node => setCleanItem(node, true));
|
||||||
|
setCleanItem(section, true);
|
||||||
// #header section has no codemirror
|
updateTitle();
|
||||||
const cm = section.CodeMirror;
|
|
||||||
if (cm) {
|
|
||||||
section.savedValue = cm.changeGeneration();
|
|
||||||
updateTitle();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleStyle() {
|
function toggleStyle() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user