Add config cancel button

This commit is contained in:
Rob Garrison 2017-08-26 10:03:28 -05:00
parent 2df6b8bca0
commit 2c234893e2
2 changed files with 6 additions and 1 deletions

View File

@ -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;
}

View File

@ -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',