| 5 | import features from '../feature-manager.js'; |
| 6 | |
| 7 | function init(): false | void { |
| 8 | const originalPreviousNext = $optional('.commit .float-right.ButtonGroup') // Legacy |
| 9 | ?? $optional('[class^="prc-ButtonGroup-ButtonGroup"]:has(a[aria-label$="previous commit" i])'); |
| 10 | if (!originalPreviousNext) { |
| 11 | return false; |
| 12 | } |
| 13 | |
| 14 | // Wrap the button in a <div> to avoid #4503 |
| 15 | $([ |
| 16 | '#files', // Legacy |
| 17 | '[class^="DiffPlaceholder-module__DiffPlaceholderSVG"]', |
| 18 | ]).after( |
| 19 | <div className="d-flex flex-justify-end mb-3 tmp-mb-3"> |
| 20 | {originalPreviousNext.cloneNode(true)} |
| 21 | </div>, |
| 22 | ); |
| 23 | } |
| 24 | |
| 25 | void features.add(import.meta.url, { |
| 26 | include: [ |