From fc424aee9e3a2bc8cf0126db3684845bf14f50e6 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Fri, 17 Aug 2018 15:31:59 +0100 Subject: [PATCH] Adapt styles to avoid layout breaking/showing options that do not make sense when no history entries are loaded. --- services/web/app/views/project/editor/history/toolbarV2.pug | 6 +++--- services/web/public/stylesheets/app/editor/history-v2.less | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/services/web/app/views/project/editor/history/toolbarV2.pug b/services/web/app/views/project/editor/history/toolbarV2.pug index a683facba4..2acb93854b 100644 --- a/services/web/app/views/project/editor/history/toolbarV2.pug +++ b/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")} diff --git a/services/web/public/stylesheets/app/editor/history-v2.less b/services/web/public/stylesheets/app/editor/history-v2.less index cfefbb462c..8c944062b7 100644 --- a/services/web/public/stylesheets/app/editor/history-v2.less +++ b/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;