mirror of
https://github.com/gitbucket/gitbucket.git
synced 2026-05-07 20:07:30 +02:00
Focus to textarea at add and edit a comment
This commit is contained in:
@@ -628,7 +628,8 @@ trait RepositoryViewerControllerBase extends ControllerBase {
|
||||
newLineNumber,
|
||||
issueId,
|
||||
hasWritePermission = hasDeveloperRole(repository.owner, repository.name, context.loginAccount),
|
||||
repository = repository
|
||||
repository = repository,
|
||||
focus = true
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
@@ -10,12 +10,13 @@
|
||||
styleClass: String = "",
|
||||
placeholder: String = "Leave a comment",
|
||||
elastic: Boolean = false,
|
||||
focus: Boolean = false,
|
||||
tabIndex: Int = -2,
|
||||
uid: Long = new java.util.Date().getTime())(implicit context: gitbucket.core.controller.Context)
|
||||
@import gitbucket.core.view.helpers
|
||||
<div class="tabbable">
|
||||
<ul class="nav nav-tabs fill-width" style="margin-bottom: 10px;">
|
||||
<li class="active"><a href="#tab@uid" data-toggle="tab">Write</a></li>
|
||||
<li class="active"><a href="#tab@uid" data-toggle="tab" id="write@uid">Write</a></li>
|
||||
<li><a href="#tab@(uid + 1)" data-toggle="tab" id="preview@uid">Preview</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
@@ -46,6 +47,13 @@ $(function(){
|
||||
$('#content@uid').elastic();
|
||||
$('#content@uid').trigger('blur');
|
||||
}
|
||||
@if(focus){
|
||||
$('#content@uid').trigger('focus');
|
||||
}
|
||||
|
||||
$('#write@uid').on('shown.bs.tab', function(){
|
||||
$('#content@uid').trigger('focus');
|
||||
});
|
||||
|
||||
$('#preview@uid').click(function(){
|
||||
$('#preview-area@uid').html('<img src="@helpers.assets("/common/images/indicator.gif")"> Previewing...');
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
completionContext = "issues",
|
||||
style = "",
|
||||
elastic = true,
|
||||
focus = true,
|
||||
tabIndex = 1
|
||||
)
|
||||
<div class="pull-right">
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
completionContext = "issues",
|
||||
style = "",
|
||||
elastic = true,
|
||||
focus = true,
|
||||
tabIndex = 1
|
||||
)
|
||||
<div class="pull-right">
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
issueId: Option[Int] = None,
|
||||
hasWritePermission: Boolean,
|
||||
repository: gitbucket.core.service.RepositoryService.RepositoryInfo,
|
||||
focus: Boolean = false,
|
||||
uid: Long = new java.util.Date().getTime())(implicit context: gitbucket.core.controller.Context)
|
||||
@import gitbucket.core.view.helpers
|
||||
@if(context.loginAccount.isDefined){
|
||||
@@ -23,6 +24,7 @@
|
||||
completionContext = "issues",
|
||||
style = "height: 100px; max-height: 150px;",
|
||||
elastic = true,
|
||||
focus = focus,
|
||||
uid = uid
|
||||
)
|
||||
</div>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
completionContext = "issues",
|
||||
style = "",
|
||||
elastic = true,
|
||||
focus = true,
|
||||
tabIndex = 1
|
||||
)
|
||||
<div class="text-right">
|
||||
|
||||
Reference in New Issue
Block a user