remove cruft; silence eslint

This commit is contained in:
tophf 2017-11-23 08:18:55 +03:00
parent 479d95711b
commit 74701810b7
4 changed files with 8 additions and 16 deletions

View File

@ -235,7 +235,7 @@
</span>
</div>
</details>
<details id="lint">
<details id="lint" class="hidden">
<summary>
<h2 i18n-text="linterIssues">: <span id="issue-count"></span><!-- EAT SPACE
--><svg id="lint-help" class="svg-icon info intercepts-click">

View File

@ -5,11 +5,13 @@
/* global CSSLint initLint linterConfig updateLintReport renderLintReport updateLinter */
/* global mozParser createSourceEditor */
/* global closeCurrentTab regExpTester messageBox */
/* global initColorpicker */
'use strict';
onDOMready()
.then(() => Promise.all([
window.initColorpicker(),
initColorpicker(),
initCollapsibles(),
]))
.then(init);

View File

@ -142,11 +142,6 @@ function initLint() {
$('#linter-settings').addEventListener('click', linterConfig.openOnClick);
window.addEventListener('resize', resizeLintReport);
// touch devices don't have onHover events so the element we'll be toggled via clicking (touching)
if ('ontouchstart' in document.body) {
$('#lint h2').addEventListener('click', toggleLintReport);
}
updateLinter();
linterConfig.watchStorage();
prefs.subscribe(['editor.linter'], updateLinter);
@ -164,7 +159,7 @@ function updateLinter({immediately, linter = linterConfig.getDefault()} = {}) {
loadLinterAssets(linter)
]).then(updateEditors);
$('#linter-settings').style.display = !linter ? 'none' : 'inline-block';
$('#lint').style.display = 'none';
$('#lint').classList.add('hidden');
function updateEditors() {
CodeMirror.defaults.lint = linterConfig.getForCodeMirror(linter);
@ -336,7 +331,7 @@ function renderLintReport(someBlockChanged) {
if (someBlockChanged || newContent.children.length !== content.children.length) {
$('#issue-count').textContent = issueCount;
container.replaceChild(newContent, content);
container.style.display = newContent.children.length ? 'block' : 'none';
container.classList.toggle('hidden', !newContent.children.length);
resizeLintReport();
}
}
@ -370,10 +365,6 @@ function gotoLintIssue(event) {
});
}
function toggleLintReport() {
$('#lint').classList.toggle('collapsed');
}
function showLintHelp() {
const linter = linterConfig.getDefault();
const baseUrl = linter === 'stylelint'

View File

@ -1,6 +1,6 @@
/* global CodeMirror dirtyReporter initLint beautify showKeyMapHelp */
/* global showToggleStyleHelp goBackToManage updateLintReportIfEnabled */
/* global hotkeyRerouter setupAutocomplete setupOptionsExpand */
/* global hotkeyRerouter setupAutocomplete */
/* global editors linterConfig updateLinter regExpTester mozParser */
/* global makeLink createAppliesToLineWidget messageBox */
'use strict';
@ -9,6 +9,7 @@ function createSourceEditor(style) {
// a flag for isTouched()
let hadBeenSaved = false;
document.documentElement.classList.add('usercss');
$('#sections').textContent = '';
$('#name').disabled = true;
$('#mozilla-format-heading').parentNode.remove();
@ -22,8 +23,6 @@ function createSourceEditor(style) {
appendChild: makeLink('https://github.com/openstyles/stylus/wiki/Usercss', t('externalUsercssDocument'))
}));
initCollapsibles();
const dirty = dirtyReporter();
dirty.onChange(() => {
const DIRTY = dirty.isDirty();