mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-09 06:55:54 +01:00
Remove uniqId from template arguments
This commit is contained in:
@@ -2,9 +2,8 @@
|
||||
prefix: String = "",
|
||||
style : String = "",
|
||||
right : Boolean = false,
|
||||
filter: String = "",
|
||||
uniqId: String = scala.util.Random.alphanumeric.take(4).mkString)(body: Html)
|
||||
@filterId = @{filter.toString.replaceAll("[^a-zA-Z0-9_]","_") + uniqId }
|
||||
filter: String = "")(body: Html)
|
||||
@defining(if(filter.isEmpty) "" else filter + "-" + scala.util.Random.alphanumeric.take(4).mkString){ filterId =>
|
||||
<div class="btn-group" @if(style.nonEmpty){style="@style"}>
|
||||
<button
|
||||
class="dropdown-toggle btn btn-default btn-sm" data-toggle="dropdown">
|
||||
@@ -19,13 +18,13 @@
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu@if(right){ pull-right}">
|
||||
@if(filter.nonEmpty) {
|
||||
@if(filterId.nonEmpty) {
|
||||
<li><input id="@filterId-input" type="text" class="form-control input-sm dropdown-filter-input" placeholder="@filter"/></li>
|
||||
}
|
||||
@body
|
||||
</ul>
|
||||
</div>
|
||||
@if(filter.nonEmpty) {
|
||||
@if(filterId.nonEmpty) {
|
||||
<script>
|
||||
$(window).load(function(){
|
||||
$('#@{filterId}-input').parent().click(function(e) {
|
||||
@@ -44,3 +43,4 @@ $(window).load(function(){
|
||||
});
|
||||
</script>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user