Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4aa204e

Browse files
committedMar 2, 2022
doc: add assets JS to the linting list
1 parent d3fcc59 commit 4aa204e

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed
 

‎.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ tools/icu
77
tools/lint-md/lint-md.mjs
88
benchmark/tmp
99
doc/**/*.js
10+
!doc/api_assets/*.js
1011
!.eslintrc.js

‎doc/api_assets/api.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
2-
3-
// Check if we have Javascript support
2+
3+
// Check if we have JavaScript support
44
document.querySelector(':root').classList.add('has-js');
55

66
// Restore user mode preferences
@@ -38,8 +38,8 @@ if (themeToggleButton) {
3838

3939
// Handle pickers with click/taps rather than hovers
4040
const pickers = document.querySelectorAll('.picker-header');
41-
for(const picker of pickers) {
42-
picker.addEventListener('click', e => {
41+
for (const picker of pickers) {
42+
picker.addEventListener('click', (e) => {
4343
if (!e.target.closest('.picker')) {
4444
e.preventDefault();
4545
}
@@ -57,17 +57,17 @@ for(const picker of pickers) {
5757
}
5858

5959
// Track when the header is in sticky position
60-
const header = document.querySelector(".header");
60+
const header = document.querySelector('.header');
6161
let ignoreNextIntersection = false;
6262
new IntersectionObserver(
6363
([e]) => {
6464
const currentStatus = header.classList.contains('is-pinned');
6565
const newStatus = e.intersectionRatio < 1;
6666

6767
// Same status, do nothing
68-
if(currentStatus === newStatus) {
68+
if (currentStatus === newStatus) {
6969
return;
70-
} else if(ignoreNextIntersection) {
70+
} else if (ignoreNextIntersection) {
7171
ignoreNextIntersection = false;
7272
return;
7373
}
@@ -84,4 +84,4 @@ new IntersectionObserver(
8484
header.classList.toggle('is-pinned', newStatus);
8585
},
8686
{ threshold: [1] }
87-
).observe(header);
87+
).observe(header);

0 commit comments

Comments
 (0)
Please sign in to comment.