Use preventDefault
This commit is contained in:
parent
b89fb440f7
commit
287f16dcfa
|
@ -206,7 +206,8 @@ function showLintHelp() {
|
||||||
|
|
||||||
function setupStylelintSettingsEvents() {
|
function setupStylelintSettingsEvents() {
|
||||||
let timer;
|
let timer;
|
||||||
$('#help-popup .save').addEventListener('click', () => {
|
$('#help-popup .save').addEventListener('click', event => {
|
||||||
|
event.preventDefault();
|
||||||
const json = tryJSONparse($('#help-popup textarea').value);
|
const json = tryJSONparse($('#help-popup textarea').value);
|
||||||
if (json && json.rules) {
|
if (json && json.rules) {
|
||||||
setStylelintRules(json.rules);
|
setStylelintRules(json.rules);
|
||||||
|
@ -225,15 +226,14 @@ function setupStylelintSettingsEvents() {
|
||||||
}
|
}
|
||||||
}, 3000);
|
}, 3000);
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
$('#help-popup .reset').addEventListener('click', () => {
|
$('#help-popup .reset').addEventListener('click', event => {
|
||||||
|
event.preventDefault();
|
||||||
setStylelintRules();
|
setStylelintRules();
|
||||||
$('#help-popup .settings').value = JSON.stringify({rules: stylelintDefaultConfig.rules}, null, 2);
|
$('#help-popup .settings').value = JSON.stringify({rules: stylelintDefaultConfig.rules}, null, 2);
|
||||||
if (prefs.get('editor.linter') === 'stylelint') {
|
if (prefs.get('editor.linter') === 'stylelint') {
|
||||||
updateLinter('stylelint');
|
updateLinter('stylelint');
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user