diff --git a/src/components/AppSidebar/AppSidebar.vue b/src/components/AppSidebar/AppSidebar.vue index 615314893e..a4b263bf8d 100644 --- a/src/components/AppSidebar/AppSidebar.vue +++ b/src/components/AppSidebar/AppSidebar.vue @@ -29,15 +29,21 @@
- +
-
+
+ + +

{{ title }}

+

{{ subtitle }}

+
@@ -45,6 +51,7 @@
+
-
+ +
-
+
@@ -95,20 +103,35 @@ export default { background: { type: String, default: '' + }, + starred: { + type: Boolean, + default: null } }, data() { return { tabs: [], - activeTab: '' + activeTab: '', + isStarred: this.starred + } + }, + computed: { + canStar() { + return this.isStarred !== null } }, watch: { + // update local value if parent changes active: function(active) { // prevent running it twice if (active !== this.activeTab) { this.updateActive() } + }, + // update local value if parent changes + starred: function() { + this.isStarred = this.starred } }, mounted() { @@ -142,6 +165,10 @@ export default { : this.tabs ? this.tabs[0].id : '' + }, + toggleStarred() { + this.isStarred = !this.isStarred + this.$emit('update:starred', this.isStarred) } } } @@ -199,9 +226,12 @@ $sidebar-max-width: 500px; } &__desc { position: relative; - padding-left: 10px; + padding: 10px 44px 10px 10px; + &--with-star { + padding: 10px 44px; + } h3, h4 { - width: calc(100% - 44px); + width: 100%; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; @@ -209,13 +239,25 @@ $sidebar-max-width: 500px; } h3 { font-size: 16px; - padding: 10px 0; + padding: 0; + + h4 { + padding-top: 10px; + } } h4 { font-size: 14px; - padding-bottom: 5px; + padding: 0; opacity: .7; } + .app-sidebar-header__star { + display: block; + width: 44px; + height: 44px; + padding: 14px; + position: absolute; + top: 0; + left: 0; + } .app-sidebar-header__menu { position: absolute; right: 0; @@ -267,6 +309,9 @@ $sidebar-max-width: 500px; &__content { position: relative; margin: 10px; + > :not(section) { + display: none; + } } } } diff --git a/src/components/AppSidebarTab/AppSidebarTab.vue b/src/components/AppSidebarTab/AppSidebarTab.vue index bbe483291a..1abfa76b23 100644 --- a/src/components/AppSidebarTab/AppSidebarTab.vue +++ b/src/components/AppSidebarTab/AppSidebarTab.vue @@ -46,7 +46,7 @@ export default { }, computed: { id() { - return this.name.toLowerCase().replace(/ /g, '-') + return 'tab-' + this.name.toLowerCase().replace(/ /g, '-') }, isActive() { return this.$parent.activeTab === this.id