Expand/Collapse all changed files (#23639)
close #23628 Now in `...` dropdown, you can expand or collapse all diff files that have loaded. https://user-images.githubusercontent.com/33891828/227749688-2d406916-3347-49f6-93a5-4092a00e8809.mov Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
parent
f2b98d8259
commit
bedad23f9e
6 changed files with 45 additions and 19 deletions
|
@ -1,12 +1,13 @@
|
|||
import $ from 'jquery';
|
||||
import {initCompReactionSelector} from './comp/ReactionSelector.js';
|
||||
import {initRepoIssueContentHistory} from './repo-issue-content.js';
|
||||
import {initViewedCheckboxListenerFor, countAndUpdateViewedFiles} from './pull-view-file.js';
|
||||
import {initDiffFileTree} from './repo-diff-filetree.js';
|
||||
import {validateTextareaNonEmpty} from './comp/ComboMarkdownEditor.js';
|
||||
import {initViewedCheckboxListenerFor, countAndUpdateViewedFiles, initExpandAndCollapseFilesButton} from './pull-view-file.js';
|
||||
|
||||
const {csrfToken} = window.config;
|
||||
|
||||
export function initRepoDiffReviewButton() {
|
||||
function initRepoDiffReviewButton() {
|
||||
const $reviewBox = $('#review-box');
|
||||
const $counter = $reviewBox.find('.review-comments-counter');
|
||||
|
||||
|
@ -25,7 +26,7 @@ export function initRepoDiffReviewButton() {
|
|||
});
|
||||
}
|
||||
|
||||
export function initRepoDiffFileViewToggle() {
|
||||
function initRepoDiffFileViewToggle() {
|
||||
$('.file-view-toggle').on('click', function () {
|
||||
const $this = $(this);
|
||||
$this.parent().children().removeClass('active');
|
||||
|
@ -37,7 +38,7 @@ export function initRepoDiffFileViewToggle() {
|
|||
});
|
||||
}
|
||||
|
||||
export function initRepoDiffConversationForm() {
|
||||
function initRepoDiffConversationForm() {
|
||||
$(document).on('submit', '.conversation-holder form', async (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
|
@ -152,7 +153,7 @@ function loadMoreFiles(url, callback) {
|
|||
});
|
||||
}
|
||||
|
||||
export function initRepoDiffShowMore() {
|
||||
function initRepoDiffShowMore() {
|
||||
$(document).on('click', 'a#diff-show-more-files', (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
|
@ -186,3 +187,15 @@ export function initRepoDiffShowMore() {
|
|||
});
|
||||
});
|
||||
}
|
||||
|
||||
export function initRepoDiffView() {
|
||||
const diffFileList = $('#diff-file-list');
|
||||
if (diffFileList.length === 0) return;
|
||||
initDiffFileTree();
|
||||
initRepoDiffShowMore();
|
||||
initRepoDiffReviewButton();
|
||||
initRepoDiffFileViewToggle();
|
||||
initRepoDiffConversationForm();
|
||||
initViewedCheckboxListenerFor();
|
||||
initExpandAndCollapseFilesButton();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue