Fix: drop unused getCode
This commit is contained in:
parent
f133c3e67a
commit
2c2d849fa4
|
@ -121,7 +121,6 @@ function createSection({
|
||||||
el,
|
el,
|
||||||
cm,
|
cm,
|
||||||
render,
|
render,
|
||||||
getCode,
|
|
||||||
getModel,
|
getModel,
|
||||||
remove,
|
remove,
|
||||||
destroy,
|
destroy,
|
||||||
|
@ -265,10 +264,6 @@ function createSection({
|
||||||
showHelp(t('appliesLabel'), t('appliesHelp'));
|
showHelp(t('appliesLabel'), t('appliesHelp'));
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCode() {
|
|
||||||
return cm.getValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
function remove() {
|
function remove() {
|
||||||
linter.disableForEditor(cm);
|
linter.disableForEditor(cm);
|
||||||
el.classList.add('removed');
|
el.classList.add('removed');
|
||||||
|
|
|
@ -485,7 +485,7 @@ function createSectionsEditor(style) {
|
||||||
if (sections.every(s => s.isRemoved() || s === section)) {
|
if (sections.every(s => s.isRemoved() || s === section)) {
|
||||||
throw new Error('Cannot remove last section');
|
throw new Error('Cannot remove last section');
|
||||||
}
|
}
|
||||||
if (!section.getCode()) {
|
if (section.cm.isBlank()) {
|
||||||
const index = sections.indexOf(section);
|
const index = sections.indexOf(section);
|
||||||
sections.splice(index, 1);
|
sections.splice(index, 1);
|
||||||
section.el.remove();
|
section.el.remove();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user