From 2c234893e21b41141451fef652c54d29f8e6bd07 Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Sat, 26 Aug 2017 10:03:28 -0500 Subject: [PATCH] Add config cancel button --- edit/edit.css | 2 +- edit/lint.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/edit/edit.css b/edit/edit.css index 83ca4e93..5e54a2b1 100644 --- a/edit/edit.css +++ b/edit/edit.css @@ -418,7 +418,7 @@ body[data-match-highlight="selection"] .CodeMirror-selection-highlight-scrollbar #help-popup .rules { padding: 0 15px; } -#help-popup .save { +#help-popup button { margin-right: 3px; } diff --git a/edit/lint.js b/edit/lint.js index ff6c0f94..8f1e3c5f 100644 --- a/edit/lint.js +++ b/edit/lint.js @@ -322,6 +322,10 @@ function setupLinterSettingsEvents(popup) { popup.codebox.setValue(stringifyRules(rules)); updateLinter(linter); }); + $('.cancel', popup).addEventListener('click', event => { + event.preventDefault(); + $('.dismiss').dispatchEvent(new Event('click')); + }); } function openStylelintSettings() { @@ -370,6 +374,7 @@ function setupLinterPopup(rules) { ] }), makeButton('save', 'styleSaveLabel'), + makeButton('cancel', 'confirmCancel'), makeButton('reset', 'genericResetLabel'), $element({ tag: 'span',