Jelajahi Sumber

templates/label: another minor style improve

Unknwon 8 tahun lalu
induk
melakukan
71753cdd46

+ 2 - 2
public/config.codekit

@@ -1,6 +1,6 @@
 {
 "CodeKitInfo": "This is a CodeKit 2.x project configuration file. It is designed to sync project settings across multiple machines. MODIFYING THE CONTENTS OF THIS FILE IS A POOR LIFE DECISION. If you do so, you will likely cause CodeKit to crash. This file is not useful unless accompanied by the project that created it in CodeKit 2. This file is not backwards-compatible with CodeKit 1.x. For more information, see: http:\/\/incident57.com\/codekit",
-"creatorBuild": "19127",
+"creatorBuild": "19115",
 "files": {
 	"\/css\/github.min.css": {
 		"fileType": 16,
@@ -66,7 +66,7 @@
 		"fileType": 32768,
 		"ignore": 0,
 		"ignoreWasSetByUser": 0,
-		"initialSize": 514087,
+		"initialSize": 4048,
 		"inputAbbreviatedPath": "\/img\/avatar_default.png",
 		"outputAbbreviatedPath": "\/img\/avatar_default.png",
 		"outputPathIsOutsideProject": 0,

+ 1 - 0
public/css/gogs.css

@@ -1181,6 +1181,7 @@ footer .ui.language .menu {
   float: left;
   margin-left: -5px;
   margin-right: -7px;
+  width: 16px;
 }
 .repository .filter.menu .menu {
   max-height: 300px;

+ 8 - 3
public/js/gogs.js

@@ -108,16 +108,21 @@ function initCommentForm() {
         });
     }
 
+    // Add   to each unselected label to keep UI looks good.
+    // This should be added directly to HTML but somehow just get empty <span> on this page.
+    $labelMenu.find('.item:not(.no-select) .octicon:not(.octicon-check)').each(function () {
+        $(this).html('&nbsp;');
+    })
     $labelMenu.find('.item:not(.no-select)').click(function () {
         if ($(this).hasClass('checked')) {
             $(this).removeClass('checked');
-            $(this).find('.octicon').removeClass('octicon-check');
+            $(this).find('.octicon').removeClass('octicon-check').html('&nbsp;');
             if (hasLabelUpdateAction) {
                 updateIssueMeta($labelMenu.data('update-url'), "detach", $(this).data('id'));
             }
         } else {
             $(this).addClass('checked');
-            $(this).find('.octicon').addClass('octicon-check');
+            $(this).find('.octicon').addClass('octicon-check').html('');
             if (hasLabelUpdateAction) {
                 updateIssueMeta($labelMenu.data('update-url'), "attach", $(this).data('id'));
             }
@@ -147,7 +152,7 @@ function initCommentForm() {
 
         $(this).parent().find('.item').each(function () {
             $(this).removeClass('checked');
-            $(this).find('.octicon').removeClass('octicon-check');
+            $(this).find('.octicon').removeClass('octicon-check').html('&nbsp;');
         });
 
         $list.find('.item').each(function () {

+ 1 - 0
public/less/_repository.less

@@ -97,6 +97,7 @@
 			float: left;
 			margin-left: -5px;
 			margin-right: -7px;
+			width: 16px;
 		}
 		.menu {
 			max-height: 300px;

+ 1 - 1
templates/repo/issue/list.tmpl

@@ -33,7 +33,7 @@
 				<div class="menu">
 					<a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_label_no_select"}}</a>
 					{{range .Labels}}
-						<a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}"><span class="octicon {{if eq $.SelectLabels .ID}}octicon-check{{end}}">&nbsp;</span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name | Sanitize}}</a>
+						<a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}"><span class="octicon {{if eq $.SelectLabels .ID}}octicon-check{{end}}">{{if not .IsChecked}}&nbsp;{{end}}</span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name | Sanitize}}</a>
 					{{end}}
 				</div>
 			</div>

+ 1 - 1
templates/repo/issue/new_form.tmpl

@@ -41,7 +41,7 @@
 				<div class="filter menu" data-id="#label_ids">
 					<div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_labels"}}</div>
 					{{range .Labels}}
-						<a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}"><span class="octicon {{if .IsChecked}}octicon-check{{end}}">&nbsp;</span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a>
+						<a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}"><span class="octicon {{if .IsChecked}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a>
 					{{end}}
 				</div>
 			</div>