diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2020-06-14 07:24:01 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2020-06-14 07:24:01 +0200 |
commit | b1f5be22e6451d7fefe7b850c20d7f6b52073aa7 (patch) | |
tree | d24bffeece1e0a31f6ddb76b5abda5d9688e5754 /src/main | |
parent | 60c0892466c8e48faba3e7bbe2b462c47aa032fa (diff) |
Make ESLint happy.
Change-Id: I3a8cd7a72467e5f1cdef1d3383f8c5b9f6bb27e7
Diffstat (limited to 'src/main')
3 files changed, 12 insertions, 10 deletions
diff --git a/src/main/resources/META-INF/resources/bookmarks/MlkBookmarkSubmissionForm.js b/src/main/resources/META-INF/resources/bookmarks/MlkBookmarkSubmissionForm.js index 3b93305..7c71518 100644 --- a/src/main/resources/META-INF/resources/bookmarks/MlkBookmarkSubmissionForm.js +++ b/src/main/resources/META-INF/resources/bookmarks/MlkBookmarkSubmissionForm.js @@ -74,9 +74,10 @@ export class MlkBookmarkSubmissionForm extends HTMLElement { get editedId() /*:number | null*/ { let attr = this.getAttribute("edited-id"); - if (attr === undefined || attr === null) { + if (attr === null) { return null; } + return parseInt(attr, 10); } diff --git a/src/main/resources/META-INF/resources/lazychat/MlkLazychatSubmissionForm.js b/src/main/resources/META-INF/resources/lazychat/MlkLazychatSubmissionForm.js index 4c4aca8..7bd6d4d 100644 --- a/src/main/resources/META-INF/resources/lazychat/MlkLazychatSubmissionForm.js +++ b/src/main/resources/META-INF/resources/lazychat/MlkLazychatSubmissionForm.js @@ -58,9 +58,10 @@ export class MlkLazychatSubmissionForm extends HTMLElement { get editedId() /*:number | null*/ { let attr = this.getAttribute("edited-id"); - if (attr === undefined || attr === null) { + if (attr === null) { return null; } + return parseInt(attr, 10); } diff --git a/src/main/resources/META-INF/resources/posts/postList.js b/src/main/resources/META-INF/resources/posts/postList.js index 8ffb7ca..1b6f9f5 100644 --- a/src/main/resources/META-INF/resources/posts/postList.js +++ b/src/main/resources/META-INF/resources/posts/postList.js @@ -2,21 +2,21 @@ document.addEventListener('DOMContentLoaded', () => { let bookmarkSubmissionPane = document.getElementById('bookmark-submission-pane'); if (bookmarkSubmissionPane) { let bookmarkSubmissionForm = document.getElementById('bookmark-submission-form'); - bookmarkSubmissionPane.addEventListener('opened',() => bookmarkSubmissionForm.focus()); + bookmarkSubmissionPane.addEventListener('opened', () => bookmarkSubmissionForm.focus()); } let lazychatSubmissionPane = document.getElementById('lazychat-submission-pane'); if (lazychatSubmissionPane) { let lazychatSubmissionForm = document.getElementById('lazychat-submission-form'); - lazychatSubmissionPane.addEventListener('opened',() => lazychatSubmissionForm.focus()); + lazychatSubmissionPane.addEventListener('opened', () => lazychatSubmissionForm.focus()); } let lazychatMessages = document.getElementsByClassName('lazychat-message'); for (let message of lazychatMessages) { - let editorPane = message.getElementsByClassName('lazychat-editor-pane')[0]; + let [editorPane] = message.getElementsByClassName('lazychat-editor-pane'); if (editorPane) { - let form = message.getElementsByTagName('mlk-lazychat-submission-form')[0]; - let editButton = message.getElementsByClassName('lazychat-edit-button')[0]; + let [form] = message.getElementsByTagName('mlk-lazychat-submission-form'); + let [editButton] = message.getElementsByClassName('lazychat-edit-button'); editButton.addEventListener('click', () => { editorPane.toggle(); form.focus(); @@ -26,10 +26,10 @@ document.addEventListener('DOMContentLoaded', () => { let bookmarks = document.getElementsByClassName('bookmark'); for (let bookmark of bookmarks) { - let editorPane = bookmark.getElementsByClassName('editor-pane')[0]; + let [editorPane] = bookmark.getElementsByClassName('editor-pane'); if (editorPane) { - let form = bookmark.getElementsByTagName('mlk-bookmark-submission-form')[0]; - let editButton = bookmark.getElementsByClassName('bookmark-edit-button')[0]; + let [form] = bookmark.getElementsByTagName('mlk-bookmark-submission-form'); + let [editButton] = bookmark.getElementsByClassName('bookmark-edit-button'); editButton.addEventListener('click', () => { editorPane.toggle(); form.focus(); |