Fix: drop unused getCode

This commit is contained in:
eight 2018-10-14 16:20:14 +08:00
parent f133c3e67a
commit 2c2d849fa4
2 changed files with 1 additions and 6 deletions

View File

@ -121,7 +121,6 @@ function createSection({
el,
cm,
render,
getCode,
getModel,
remove,
destroy,
@ -265,10 +264,6 @@ function createSection({
showHelp(t('appliesLabel'), t('appliesHelp'));
}
function getCode() {
return cm.getValue();
}
function remove() {
linter.disableForEditor(cm);
el.classList.add('removed');

View File

@ -485,7 +485,7 @@ function createSectionsEditor(style) {
if (sections.every(s => s.isRemoved() || s === section)) {
throw new Error('Cannot remove last section');
}
if (!section.getCode()) {
if (section.cm.isBlank()) {
const index = sections.indexOf(section);
sections.splice(index, 1);
section.el.remove();