|
3 | 3 | /* exported toggleDeadlineForm, setDeadline, updateDeadline, deleteDependencyModal, cancelCodeComment, onOAuthLoginClick */ |
4 | 4 |
|
5 | 5 | import './publicPath.js'; |
| 6 | +import './polyfills.js'; |
6 | 7 | import './gitGraphLoader.js'; |
7 | 8 | import './semanticDropdown.js'; |
8 | 9 | import initContextPopups from './features/contextPopup'; |
@@ -2109,17 +2110,12 @@ function initCodeView() { |
2109 | 2110 | } |
2110 | 2111 | }).trigger('hashchange'); |
2111 | 2112 | } |
2112 | | - $('.ui.fold-code').on('click', (e) => { |
2113 | | - const $foldButton = $(e.target); |
2114 | | - if ($foldButton.hasClass('fa-chevron-down')) { |
2115 | | - $(e.target).parent().next().slideUp('fast', () => { |
2116 | | - $foldButton.removeClass('fa-chevron-down').addClass('fa-chevron-right'); |
2117 | | - }); |
2118 | | - } else { |
2119 | | - $(e.target).parent().next().slideDown('fast', () => { |
2120 | | - $foldButton.removeClass('fa-chevron-right').addClass('fa-chevron-down'); |
2121 | | - }); |
2122 | | - } |
| 2113 | + $('.fold-code').on('click', ({ target }) => { |
| 2114 | + const box = target.closest('.file-content'); |
| 2115 | + const folded = box.dataset.folded !== 'true'; |
| 2116 | + target.classList.add(`fa-chevron-${folded ? 'right' : 'down'}`); |
| 2117 | + target.classList.remove(`fa-chevron-${folded ? 'down' : 'right'}`); |
| 2118 | + box.dataset.folded = String(folded); |
2123 | 2119 | }); |
2124 | 2120 | function insertBlobExcerpt(e) { |
2125 | 2121 | const $blob = $(e.target); |
|
0 commit comments