Răsfoiți Sursa

Adapt styles to avoid layout breaking/showing options that do not make sense when no history entries are loaded.

Paulo Reis 8 ani în urmă
părinte
comite
fc424aee9e

+ 3 - 3
services/web/app/views/project/editor/history/toolbarV2.pug

@@ -6,7 +6,7 @@
 		i.fa.fa-spin.fa-refresh
 		|    #{translate("loading")}...
 	span.history-toolbar-selected-version(
-		ng-show="!history.loadingFileTree && !history.showOnlyLabels && !history.error"
+		ng-show="!history.loadingFileTree && !history.showOnlyLabels && history.selection.updates.length && !history.error"
 	) #{translate("browsing_project_as_of")} 
 		time.history-toolbar-time {{ history.selection.updates[0].meta.end_ts | formatDate:'Do MMM YYYY, h:mm a' }}
 	span.history-toolbar-selected-version(
@@ -19,13 +19,13 @@
 		button.history-toolbar-btn(
 			ng-click="showAddLabelDialog();"
 			ng-if="!history.showOnlyLabels"
-			ng-disabled="history.loadingFileTree"
+			ng-disabled="history.loadingFileTree || history.selection.updates.length == 0"
 		) 
 			i.fa.fa-tag
 			|  #{translate("history_label_this_version")}
 		button.history-toolbar-btn(
 			ng-click="toggleHistoryViewMode();"
-			ng-disabled="history.loadingFileTree"
+			ng-disabled="history.loadingFileTree || history.selection.updates.length == 0"
 		) 
 			i.fa.fa-exchange
 			|  #{translate("compare_to_another_version")}

+ 2 - 1
services/web/public/stylesheets/app/editor/history-v2.less

@@ -19,6 +19,7 @@
 		white-space: nowrap;
 		overflow: hidden;
 		text-overflow: ellipsis;
+		margin-right: (@line-height-computed / 2);
 	}
 		.history-toolbar-time,
 		.history-toolbar-selected-label {
@@ -33,7 +34,7 @@
 			.btn-xs;
 			padding-left: @padding-small-horizontal;
 			padding-right: @padding-small-horizontal;
-			margin-left: (@line-height-computed / 2);
+			margin-right: (@line-height-computed / 2);
 		}
 	.history-toolbar-entries-list {
 		flex: 0 0 @changesListWidth;