From 287f16dcfaed1b236931a7117f9cb38de4d4db72 Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Fri, 18 Aug 2017 10:46:09 -0500 Subject: [PATCH] Use preventDefault --- edit/lint.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/edit/lint.js b/edit/lint.js index bf3336a8..d561d32d 100644 --- a/edit/lint.js +++ b/edit/lint.js @@ -206,7 +206,8 @@ function showLintHelp() { function setupStylelintSettingsEvents() { let timer; - $('#help-popup .save').addEventListener('click', () => { + $('#help-popup .save').addEventListener('click', event => { + event.preventDefault(); const json = tryJSONparse($('#help-popup textarea').value); if (json && json.rules) { setStylelintRules(json.rules); @@ -225,15 +226,14 @@ function setupStylelintSettingsEvents() { } }, 3000); } - return false; }); - $('#help-popup .reset').addEventListener('click', () => { + $('#help-popup .reset').addEventListener('click', event => { + event.preventDefault(); setStylelintRules(); $('#help-popup .settings').value = JSON.stringify({rules: stylelintDefaultConfig.rules}, null, 2); if (prefs.get('editor.linter') === 'stylelint') { updateLinter('stylelint'); } - return false; }); }