Fix stylelint error message timer
This commit is contained in:
parent
7c5b4c2bcf
commit
dded798ee3
|
@ -1902,7 +1902,9 @@ function showHelp(title, body) {
|
|||
((e.keyCode || e.which) === 27 && !e.altKey && !e.ctrlKey && !e.shiftKey && !e.metaKey)
|
||||
) {
|
||||
div.style.display = '';
|
||||
document.querySelector('.contents').textContent = '';
|
||||
const contents = $('.contents');
|
||||
contents.textContent = '';
|
||||
clearTimeout(contents.timer);
|
||||
document.removeEventListener('keydown', closeHelp);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -216,7 +216,6 @@ function showLintHelp() {
|
|||
}
|
||||
|
||||
function setupStylelintSettingsEvents(popup) {
|
||||
let timer;
|
||||
popup.querySelector('.save').addEventListener('click', event => {
|
||||
event.preventDefault();
|
||||
const json = tryJSONparse(popup.codebox.getValue());
|
||||
|
@ -228,8 +227,8 @@ function setupStylelintSettingsEvents(popup) {
|
|||
}
|
||||
} else {
|
||||
$('#help-popup .error').classList.add('show');
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(() => {
|
||||
clearTimeout($('#help-popup .contents').timer);
|
||||
$('#help-popup .contents').timer = setTimeout(() => {
|
||||
// popup may be closed at this point
|
||||
const error = $('#help-popup .error');
|
||||
if (error) {
|
||||
|
@ -267,7 +266,6 @@ function setupStylelintPopup(rules) {
|
|||
cm.setOption('lint', 'json');
|
||||
}
|
||||
const popup = showCodeMirrorPopup(t('setStylelintRules'), $element({
|
||||
className: 'contents',
|
||||
appendChild: [
|
||||
$element({
|
||||
tag: 'p',
|
||||
|
|
Loading…
Reference in New Issue
Block a user