()
| 15 | ); |
| 16 | |
| 17 | function init(): void | false { |
| 18 | const checkbox = $optional('input[name="collab_privs"]'); |
| 19 | if (!checkbox) { |
| 20 | return false; |
| 21 | } |
| 22 | |
| 23 | if (pageDetect.isPRConversation()) { |
| 24 | attachElement( |
| 25 | closestElement('.discussion-sidebar-item', checkbox), |
| 26 | {after: getWarning}, |
| 27 | ); |
| 28 | } else { |
| 29 | const option = closestElement('.js-collab-option', checkbox); |
| 30 | |
| 31 | // Prevent layout shifting when warning appears |
| 32 | option.classList.remove('flex-auto'); |
| 33 | const actionRow = option.parentElement!; |
| 34 | actionRow.classList.add('mt-1'); |
| 35 | actionRow.parentElement!.classList.remove('flex-wrap'); |
| 36 | |
| 37 | attachElement( |
| 38 | actionRow.lastElementChild!, |
| 39 | {after: getWarning}, |
| 40 | ); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | void features.add(import.meta.url, { |
| 45 | include: [ |
nothing calls this directly
no test coverage detected