[Notice] Announcing the End of Demo Server [Read me]

ui.Select2: fix .branche-label styles for other branch types
@60e5822f6a9f76c792f3181df4f3a999c7c71ad6
--- app/assets/stylesheets/less/_override.less
+++ app/assets/stylesheets/less/_override.less
... | ... | @@ -339,3 +339,7 @@ |
339 | 339 |
.pika-table abbr[title] { |
340 | 340 |
cursor: default; |
341 | 341 |
} |
342 |
+ |
|
343 |
+.select2-chosen .branch-label { |
|
344 |
+ margin-top:-2px; |
|
345 |
+} |
--- app/assets/stylesheets/less/_page.less
+++ app/assets/stylesheets/less/_page.less
... | ... | @@ -3866,18 +3866,26 @@ |
3866 | 3866 |
} |
3867 | 3867 |
|
3868 | 3868 |
.branch-label { |
3869 |
+ display:inline-block; |
|
3869 | 3870 |
color:#fff; |
3871 |
+ font-size:11px; |
|
3872 |
+ background:@yobi-gray; |
|
3870 | 3873 |
text-shadow: none; |
3874 |
+ text-align:center; |
|
3875 |
+ min-width:50px; |
|
3876 |
+ height:20px; |
|
3877 |
+ line-height:20px; |
|
3878 |
+ margin: 0 3px 0 0; |
|
3879 |
+ vertical-align: middle; |
|
3871 | 3880 |
.border-radius(2px); |
3872 | 3881 |
|
3882 |
+ &.unknown { |
|
3883 |
+ display: none; |
|
3884 |
+ } |
|
3873 | 3885 |
&.branch { |
3874 |
- padding: 2px 4px; |
|
3875 |
- margin: 0 3px 0 0; |
|
3876 | 3886 |
background-color: @yobi-yello-dark; |
3877 | 3887 |
} |
3878 | 3888 |
&.tag { |
3879 |
- padding: 2px 4px; |
|
3880 |
- margin: 0 3px 0 0; |
|
3881 | 3889 |
background-color: @yobi-cyan; |
3882 | 3890 |
} |
3883 | 3891 |
} |
--- public/javascripts/common/yobi.ui.Select2.js
+++ public/javascripts/common/yobi.ui.Select2.js
... | ... | @@ -110,7 +110,7 @@ |
110 | 110 |
return '<a class="label issue-label active static" data-label-id="' + labelId + '">' + text + '</a>'; |
111 | 111 |
}, |
112 | 112 |
"branch": function(itemObject){ |
113 |
- var branchType = ""; |
|
113 |
+ var branchType = "unknown"; |
|
114 | 114 |
var branchName = itemObject.text.trim(); |
115 | 115 |
var branchNameRegex = /refs\/(.[a-z]+)\/(.+)/i; |
116 | 116 |
|
... | ... | @@ -131,6 +131,8 @@ |
131 | 131 |
var tplBranchItem = $("#tplSelect2FormatBranch").text() |
132 | 132 |
|| '<strong class="branch-label ${branchType}">${branchType}</strong> ${branchName}'; |
133 | 133 |
|
134 |
+ // branchType will be "unknown" |
|
135 |
+ // if selected branch name doesn't starts with /refs |
|
134 | 136 |
var formattedResult = $yobi.tmpl(tplBranchItem, { |
135 | 137 |
"branchType": branchType, |
136 | 138 |
"branchName": branchName |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?