Fix: drop isEmpty

This commit is contained in:
eight 2018-09-01 21:38:38 +08:00
parent 8894934290
commit a7ccda3aad

View File

@ -78,19 +78,13 @@ var linterReport = (() => { // eslint-disable-line no-var
const tbody = $create('tbody');
const table = $create('table', [caption, tbody]);
const trs = [];
let empty = true;
return {
element: table,
trs,
updateAnnotations,
update,
isEmpty
update
};
function isEmpty() {
return empty;
}
function update() {
caption.textContent = typeof editor === 'object' ?
'' : `${t('sectionCode')} ${editors.indexOf(cm) + 1}`;
@ -113,8 +107,7 @@ var linterReport = (() => { // eslint-disable-line no-var
while (trs.length > i) {
trs.pop().element.remove();
}
empty = i === 0;
table.classList.toggle('empty', empty);
table.classList.toggle('empty', trs.length === 0);
function *getAnnotations() {
for (const line of lines.filter(Boolean)) {