Matthias Andreas Benkard | 12c7cac | 2020-03-26 07:19:45 +0100 | [diff] [blame] | 1 | document.addEventListener('DOMContentLoaded', () => { |
| 2 | let bookmarkSubmissionPane = document.getElementById('bookmark-submission-pane'); |
| 3 | if (bookmarkSubmissionPane) { |
| 4 | let bookmarkSubmissionForm = document.getElementById('bookmark-submission-form'); |
| 5 | bookmarkSubmissionPane.addEventListener('opened',() => bookmarkSubmissionForm.focus()); |
| 6 | } |
| 7 | |
| 8 | let lazychatSubmissionPane = document.getElementById('lazychat-submission-pane'); |
| 9 | if (lazychatSubmissionPane) { |
| 10 | let lazychatSubmissionForm = document.getElementById('lazychat-submission-form'); |
| 11 | lazychatSubmissionPane.addEventListener('opened',() => lazychatSubmissionForm.focus()); |
| 12 | } |
Matthias Andreas Benkard | 06e6c81 | 2020-04-13 17:01:35 +0200 | [diff] [blame] | 13 | |
Matthias Andreas Benkard | db23ab6 | 2020-04-13 20:01:13 +0200 | [diff] [blame^] | 14 | let lazychatMessages = document.getElementsByClassName('lazychat-message'); |
| 15 | for (let message of lazychatMessages) { |
| 16 | let editorPane = message.getElementsByClassName('lazychat-editor-pane')[0]; |
| 17 | if (editorPane) { |
| 18 | let form = message.getElementsByTagName('mlk-lazychat-submission-form')[0]; |
| 19 | let editButton = message.getElementsByClassName('lazychat-edit-button')[0]; |
| 20 | editButton.addEventListener('click', () => { |
| 21 | editorPane.toggle(); |
| 22 | form.focus(); |
| 23 | }); |
| 24 | } |
Matthias Andreas Benkard | 06e6c81 | 2020-04-13 17:01:35 +0200 | [diff] [blame] | 25 | } |
Matthias Andreas Benkard | 12c7cac | 2020-03-26 07:19:45 +0100 | [diff] [blame] | 26 | }); |