Fix: don't compose but extend

This commit is contained in:
eight 2018-09-02 15:03:15 +08:00
parent f4dca505fb
commit 2efc2d8dd2
2 changed files with 8 additions and 8 deletions

View File

@ -2,7 +2,7 @@
'use strict';
// eslint-disable-next-line no-var
var linterReport = (() => {
Object.assign(linter, (() => {
const cms = new Map();
const helpDialog = createLinterHelpDialog(getIssues);
@ -37,7 +37,7 @@ var linterReport = (() => {
updateCount();
});
return {refresh};
return {refreshReport};
function updateCount() {
const issueCount = Array.from(cms.values())
@ -66,7 +66,7 @@ var linterReport = (() => {
}
}
function refresh() {
function refreshReport() {
for (const table of cms.values()) {
table.updateCaption();
}
@ -162,4 +162,4 @@ var linterReport = (() => {
cm.focus();
cm.setSelection(anno.from);
}
})();
})());

View File

@ -5,7 +5,7 @@ global onChange initHooks setCleanGlobal
global fromMozillaFormat maximizeCodeHeight toggleContextMenuDelete
global setCleanItem updateTitle
global showAppliesToHelp beautify regExpTester setGlobalProgress setCleanSection
global clipString linter linterReport
global clipString linter
*/
'use strict';
@ -152,7 +152,7 @@ function addSection(event, section) {
cm = setupCodeMirror(div, code);
}
linter.enableForEditor(cm);
linterReport.refresh();
linter.refreshReport();
div.CodeMirror = cm;
setCleanSection(div);
return div;
@ -482,7 +482,7 @@ function removeSection(event) {
updateTitle();
cm.focus();
linter.enableForEditor(cm);
linterReport.refresh();
linter.refreshReport();
};
section.insertAdjacentElement('afterend', stub);
}
@ -490,7 +490,7 @@ function removeSection(event) {
removeAreaAndSetDirty(section);
editors.splice(editors.indexOf(cm), 1);
linter.disableForEditor(cm);
linterReport.refresh();
linter.refreshReport();
}
function removeAreaAndSetDirty(area) {