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, 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');

View File

@ -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();