Add linter config reset tooltip
This commit is contained in:
parent
1a384142ba
commit
cb177eba4b
|
@ -539,6 +539,10 @@
|
|||
"message": "Not saved due to these invalid rules:",
|
||||
"description": "Invalid linter rules will show a message followed by a list of invalid rules"
|
||||
},
|
||||
"setLinterResetMessage": {
|
||||
"message": "To undo accidental reset, press Ctrl-Z (or Cmd-Z) in the text box",
|
||||
"description": "Reset button tooltip to inform user on how to undo an accidental reset"
|
||||
},
|
||||
"showCSSLintSettings": {
|
||||
"message": "(Set rules: 0 = disabled; 1 = warning; 2 = error)",
|
||||
"description": "CSSLint rule settings values"
|
||||
|
|
12
edit/lint.js
12
edit/lint.js
|
@ -350,8 +350,14 @@ function openStylelintSettings() {
|
|||
function setupLinterPopup(rules) {
|
||||
const linter = prefs.get('editor.linter');
|
||||
const linterTitle = linter === 'stylelint' ? 'Stylelint' : 'CSSLint';
|
||||
function makeButton(className, text) {
|
||||
return $element({tag: 'button', className, type: 'button', textContent: t(text), dataset: {linter}});
|
||||
function makeButton(className, text, options = {}) {
|
||||
return $element(Object.assign(options, {
|
||||
tag: 'button',
|
||||
className,
|
||||
type: 'button',
|
||||
textContent: t(text),
|
||||
dataset: {linter}
|
||||
}));
|
||||
}
|
||||
function makeLink(url, textContent) {
|
||||
return $element({tag: 'a', target: '_blank', href: url, textContent});
|
||||
|
@ -377,7 +383,7 @@ function setupLinterPopup(rules) {
|
|||
}),
|
||||
makeButton('save', 'styleSaveLabel'),
|
||||
makeButton('cancel', 'confirmCancel'),
|
||||
makeButton('reset', 'genericResetLabel'),
|
||||
makeButton('reset', 'genericResetLabel', {title: t('setLinterResetMessage')}),
|
||||
$element({
|
||||
tag: 'span',
|
||||
className: 'saved-message',
|
||||
|
|
Loading…
Reference in New Issue
Block a user