Fix: linter.onChange -> linter.onLintingUpdated

This commit is contained in:
eight 2018-09-02 16:00:43 +08:00
parent 2fb2eb6d91
commit 09bd6218e0
2 changed files with 6 additions and 6 deletions

View File

@ -10,7 +10,7 @@ Object.assign(linter, (() => {
$('#lint-help').addEventListener('click', helpDialog.show);
}, {once: true});
linter.onChange((annotationsNotSorted, annotations, cm) => {
linter.onLintingUpdated((annotationsNotSorted, annotations, cm) => {
let table = cms.get(cm);
if (!table) {
table = createTable(cm);

View File

@ -2,7 +2,7 @@
// eslint-disable-next-line no-var
var linter = (() => {
const changeListeners = [];
const lintingUpdatedListeners = [];
const unhookListeners = [];
const linters = [];
const cms = new Set();
@ -12,7 +12,7 @@ var linter = (() => {
run,
enableForEditor,
disableForEditor,
onChange,
onLintingUpdated,
onUnhook
};
@ -20,12 +20,12 @@ var linter = (() => {
unhookListeners.push(cb);
}
function onChange(cb) {
changeListeners.push(cb);
function onLintingUpdated(cb) {
lintingUpdatedListeners.push(cb);
}
function onUpdateLinting(...args) {
for (const cb of changeListeners) {
for (const cb of lintingUpdatedListeners) {
cb(...args);
}
}