eslint: Enable prefer-arrow-callback.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-07-01 16:45:54 -07:00
committed by Tim Abbott
parent 960174408f
commit a79322bc94
160 changed files with 873 additions and 1012 deletions

View File

@@ -72,7 +72,7 @@ const loading = {
const markdownSB = new SimpleBar($(".markdown")[0]);
const fetch_page = function (path, callback) {
$.get(path, function (res) {
$.get(path, (res) => {
const $html = $(res).find(".markdown .content");
callback($html.html().trim());
@@ -87,7 +87,7 @@ const update_page = function (html_map, path) {
scrollToHash(markdownSB);
} else {
loading.name = path;
fetch_page(path, function (res) {
fetch_page(path, (res) => {
html_map.set(path, res);
$(".markdown .content").html(res);
loading.name = null;
@@ -99,7 +99,7 @@ const update_page = function (html_map, path) {
new SimpleBar($(".sidebar")[0]);
$(".sidebar.slide h2").click(function (e) {
$(".sidebar.slide h2").click((e) => {
const $next = $(e.target).next();
if ($next.is("ul")) {
@@ -146,11 +146,11 @@ $(document).on('click', '.markdown .content h1, .markdown .content h2, .markdown
scrollToHash(markdownSB);
});
$(".hamburger").click(function () {
$(".hamburger").click(() => {
$(".sidebar").toggleClass("show");
});
$(".markdown").click(function () {
$(".markdown").click(() => {
if ($(".sidebar.show").length) {
$(".sidebar.show").toggleClass("show");
}
@@ -162,7 +162,7 @@ render_code_sections();
// to the right place.
scrollToHash(markdownSB);
window.addEventListener("popstate", function () {
window.addEventListener("popstate", () => {
const path = window.location.pathname;
update_page(html_map, path);
});