Skip to content

Commit

Permalink
Merge branch 'main' into fix-css-helper
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang authored Aug 25, 2023
2 parents b699500 + 636b6ea commit dc2028c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion templates/repo/diff/box.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</div>
{{end}}
</div>
<div class="diff-detail-actions gt-df gt-ac gt-gap-2 gt-fw">
<div class="diff-detail-actions">
{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived) (not .DiffNotAvailable)}}
<div class="gt-df gt-ac gt-fc gt-whitespace-nowrap gt-mr-2">
<label for="viewed-files-summary" id="viewed-files-summary-label" data-text-changed-template="{{.locale.Tr "repo.pulls.viewed_files_label"}}">
Expand Down
16 changes: 6 additions & 10 deletions web_src/css/repo.css
Original file line number Diff line number Diff line change
Expand Up @@ -1625,10 +1625,11 @@
}

.diff-detail-actions {
/* prevent font-size from increasing element height so that .diff-detail-box comes
out with height of 47px (one line) and 77px (two lines), which is important for
position: sticky */
height: 33px;
display: flex;
align-items: center;
gap: 0.25em;
flex-wrap: wrap;
justify-content: end;
}

.diff-detail-actions > *,
Expand All @@ -1642,12 +1643,7 @@
padding-top: 0.25rem;
}
.repository .diff-detail-box .diff-detail-actions .ui.button:not(.btn-submit) {
padding-left: 0.5rem;
padding-right: 0.5rem;
display: flex;
flex-wrap: wrap;
justify-content: center;
text-align: center;
padding: 0 0.5rem;
}
}

Expand Down
6 changes: 6 additions & 0 deletions web_src/js/features/comp/ComboMarkdownEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ class ComboMarkdownEditor {
$panelPreviewer.attr('data-tab', `markdown-previewer-${elementIdCounter}`);
elementIdCounter++;

$tabEditor[0].addEventListener('click', () => {
requestAnimationFrame(() => {
this.focus();
});
});

$tabs.tab();

this.previewUrl = $tabPreviewer.attr('data-preview-url');
Expand Down

0 comments on commit dc2028c

Please sign in to comment.