mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-15 18:05:50 +01:00
Merge pull request #1829 from kounoike/pr-dropdown-close-and-comment-button
Change Close/Reopen button to dropdown-selectable button.
This commit is contained in:
@@ -25,9 +25,21 @@
|
||||
<div class="text-right">
|
||||
<input type="hidden" name="issueId" value="@issue.issueId"/>
|
||||
@if((reopenable || !issue.closed) && (isManageable || issue.openedUserName == context.loginAccount.get.userName)){
|
||||
<input type="submit" class="btn btn-default" tabindex="3" formaction="@helpers.url(repository)/issue_comments/state" value="@{if(issue.closed) "Reopen" else "Close"}" id="action"/>
|
||||
}
|
||||
<input type="hidden" id="action" name="action" value="comment"/>
|
||||
<div class="btn-group dropup">
|
||||
<input type="submit" class="btn btn-success" tabindex="2" formaction="@helpers.url(repository)/issue_comments/new" value="Comment" id="submit-button"/>
|
||||
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-right">
|
||||
<li><a id="menu-comment">Comment</a></li>
|
||||
<li><a id="menu-x-and-comment">@{if(issue.closed) "Reopen" else "Close"} and comment</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
} else {
|
||||
<input type="submit" class="btn btn-success" tabindex="2" formaction="@helpers.url(repository)/issue_comments/new" value="Comment"/>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -35,8 +47,13 @@
|
||||
}
|
||||
<script>
|
||||
$(function(){
|
||||
$('#action').click(function(){
|
||||
$('<input type="hidden">').attr('name', 'action').val($(this).val().toLowerCase()).appendTo('form');
|
||||
$('#menu-comment').click(function(){
|
||||
$('#submit-button').attr('value', 'Comment').attr('formaction', '@helpers.url(repository)/issue_comments/new');
|
||||
$('#action').val('comment');
|
||||
});
|
||||
$('#menu-x-and-comment').click(function(){
|
||||
$('#submit-button').attr('value', '@{if(issue.closed) "Reopen" else "Close"} and comment').attr('formaction', '@helpers.url(repository)/issue_comments/state');
|
||||
$('#action').val('@{if(issue.closed) "reopen" else "close"}');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user