Skip to content

Commit

Permalink
Hide command line instructions when merge form is visible (go-gitea#1…
Browse files Browse the repository at this point in the history
…3956)

* Hide commandline instructions when merge form is visible

* As per @silverwind

Co-authored-by: zeripath <art27@cantab.net>
  • Loading branch information
CirnoT and zeripath authored Dec 15, 2020
1 parent c3fc190 commit 27d0a55
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions templates/repo/issue/view_content/pull.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@
{{end}}
</div>
</div>
<div class="dib ml-3">{{$.i18n.Tr "repo.pulls.merge_instruction_hint" | Safe}}</div>
<div class="instruct" style="display:none">
<div class="instruct-toggle ml-3">{{$.i18n.Tr "repo.pulls.merge_instruction_hint" | Safe}}</div>
<div class="instruct-content" style="display:none">
<div class="ui divider"></div>
<div><h3 class="di">{{$.i18n.Tr "step1"}} </h3>{{$.i18n.Tr "repo.pulls.merge_instruction_step1_desc"}}</div>
<div class="ui secondary segment">
Expand Down
5 changes: 4 additions & 1 deletion web_src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,8 @@ async function initRepository() {
e.preventDefault();
$(`.${$(this).data('do')}-fields`).show();
$(this).parent().hide();
$('.instruct-toggle').hide();
$('.instruct-content').hide();
});
$('.merge-button > .dropdown').dropdown({
onChange(_text, _value, $choice) {
Expand All @@ -1133,6 +1135,7 @@ async function initRepository() {
e.preventDefault();
$(this).closest('.form').hide();
$mergeButton.parent().show();
$('.instruct-toggle').show();
});
initReactionSelector();
}
Expand Down Expand Up @@ -1199,7 +1202,7 @@ async function initRepository() {

function initPullRequestMergeInstruction() {
$('.show-instruction').on('click', () => {
$('.instruct').toggle();
$('.instruct-content').toggle();
});
}

Expand Down
4 changes: 4 additions & 0 deletions web_src/less/_repository.less
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,10 @@
}

&.view.issue {
.instruct-toggle {
display: inline-block;
}

.title {
padding-bottom: 0 !important;

Expand Down

0 comments on commit 27d0a55

Please sign in to comment.