From d7af2c8419df59d8b897bc57e94f6cc67bd60eca Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
Date: Tue, 20 Nov 2018 23:25:38 +0300
Subject: mentioned bug in tab-switcher, made shadow-control work in zero-state

---
 src/components/tab_switcher/tab_switcher.jsx | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'src/components/tab_switcher/tab_switcher.jsx')

diff --git a/src/components/tab_switcher/tab_switcher.jsx b/src/components/tab_switcher/tab_switcher.jsx
index 3fff38f6..ea582450 100644
--- a/src/components/tab_switcher/tab_switcher.jsx
+++ b/src/components/tab_switcher/tab_switcher.jsx
@@ -1,5 +1,7 @@
 import Vue from 'vue'
 
+// FIXME: This doesn't like v-if directly inside the tab's contents, breaks vue really bad
+
 import './tab_switcher.scss'
 
 export default Vue.component('tab-switcher', {
-- 
cgit v1.2.3-70-g09d2


From acf414e4517434d8847e842930c697b168d94cde Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
Date: Wed, 21 Nov 2018 07:38:00 +0300
Subject: changed the way tab-switcher works to avoid removing/adding nodes
 since that seems to cause issues, instead hiding nodes with css.

---
 src/components/tab_switcher/tab_switcher.jsx  | 19 ++++++++++---------
 src/components/tab_switcher/tab_switcher.scss |  5 +++++
 2 files changed, 15 insertions(+), 9 deletions(-)

(limited to 'src/components/tab_switcher/tab_switcher.jsx')

diff --git a/src/components/tab_switcher/tab_switcher.jsx b/src/components/tab_switcher/tab_switcher.jsx
index ea582450..a044b740 100644
--- a/src/components/tab_switcher/tab_switcher.jsx
+++ b/src/components/tab_switcher/tab_switcher.jsx
@@ -1,7 +1,5 @@
 import Vue from 'vue'
 
-// FIXME: This doesn't like v-if directly inside the tab's contents, breaks vue really bad
-
 import './tab_switcher.scss'
 
 export default Vue.component('tab-switcher', {
@@ -27,11 +25,14 @@ export default Vue.component('tab-switcher', {
             }
             return (<button onClick={this.activateTab(index)} class={ classes.join(' ') }>{slot.data.attrs.label}</button>)
           });
-    const contents = (
-      <div>
-        {this.$slots.default.filter(slot => slot.data)[this.active]}
-      </div>
-    );
+    const contents = this.$slots.default.filter(_=>_.data).map(( slot, index ) => {
+      const active = index === this.active
+      return (
+        <div class={active ? 'active' : 'hidden'}>
+          {slot}
+        </div>
+      )
+    });
     return (
       <div class="tab-switcher">
         <div class="tabs">
@@ -40,7 +41,7 @@ export default Vue.component('tab-switcher', {
         <div class="contents">
           {contents}
         </div>
-      </div>
-    )
+        </div>
+      )
   }
 })
diff --git a/src/components/tab_switcher/tab_switcher.scss b/src/components/tab_switcher/tab_switcher.scss
index 6f3f9f27..4740fbde 100644
--- a/src/components/tab_switcher/tab_switcher.scss
+++ b/src/components/tab_switcher/tab_switcher.scss
@@ -1,6 +1,11 @@
 @import '../../_variables.scss';
 
 .tab-switcher {
+  .contents {
+    .hidden {
+      display: none;
+    }
+  }
   .tabs {
     display: flex;
     position: relative;
-- 
cgit v1.2.3-70-g09d2


From b8b5dbf63e73e9ca7f5683cb6cca8d47e9cee49c Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
Date: Wed, 21 Nov 2018 22:08:27 +0300
Subject: fix

---
 src/components/tab_switcher/tab_switcher.jsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/components/tab_switcher/tab_switcher.jsx')

diff --git a/src/components/tab_switcher/tab_switcher.jsx b/src/components/tab_switcher/tab_switcher.jsx
index a044b740..9e3dee04 100644
--- a/src/components/tab_switcher/tab_switcher.jsx
+++ b/src/components/tab_switcher/tab_switcher.jsx
@@ -41,7 +41,7 @@ export default Vue.component('tab-switcher', {
         <div class="contents">
           {contents}
         </div>
-        </div>
-      )
+      </div>
+    )
   }
 })
-- 
cgit v1.2.3-70-g09d2


From 1b9a5a3efe783ca7cfe53116afc64756eb7a9f04 Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
Date: Sun, 16 Dec 2018 02:35:42 +0300
Subject: more visual fixes

---
 src/components/tab_switcher/tab_switcher.jsx  | 12 +++++--
 src/components/tab_switcher/tab_switcher.scss | 51 ++++++++++++++++-----------
 2 files changed, 40 insertions(+), 23 deletions(-)

(limited to 'src/components/tab_switcher/tab_switcher.jsx')

diff --git a/src/components/tab_switcher/tab_switcher.jsx b/src/components/tab_switcher/tab_switcher.jsx
index 9e3dee04..2f362c4d 100644
--- a/src/components/tab_switcher/tab_switcher.jsx
+++ b/src/components/tab_switcher/tab_switcher.jsx
@@ -18,12 +18,18 @@ export default Vue.component('tab-switcher', {
     const tabs = this.$slots.default
           .filter(slot => slot.data)
           .map((slot, index) => {
-            const classes = ['tab']
+            const classesTab = ['tab']
+            const classesWrapper = ['tab-wrapper']
 
             if (index === this.active) {
-              classes.push('active')
+              classesTab.push('active')
+              classesWrapper.push('active')
             }
-            return (<button onClick={this.activateTab(index)} class={ classes.join(' ') }>{slot.data.attrs.label}</button>)
+            return (
+              <div class={ classesWrapper.join(' ')}>
+                <button onClick={this.activateTab(index)} class={ classesTab.join(' ') }>{slot.data.attrs.label}</button>
+              </div>
+            )
           });
     const contents = this.$slots.default.filter(_=>_.data).map(( slot, index ) => {
       const active = index === this.active
diff --git a/src/components/tab_switcher/tab_switcher.scss b/src/components/tab_switcher/tab_switcher.scss
index 26b1727a..428335c0 100644
--- a/src/components/tab_switcher/tab_switcher.scss
+++ b/src/components/tab_switcher/tab_switcher.scss
@@ -19,46 +19,57 @@
       display: block;
       content: '';
       flex: 1 1 auto;
-    }
-
-    .tab, &::after, &::before {
       border-bottom: 1px solid;
       border-bottom-color: $fallback--border;
       border-bottom-color: var(--border, $fallback--border);
     }
 
-    .tab {
+    .tab-wrapper {
+      height: 28px;
+      overflow: hidden;
       position: relative;
-      border-bottom-left-radius: 0;
-      border-bottom-right-radius: 0;
-      padding: 5px 1em 99px;
-      margin-bottom: 5px - 99px - 1px;
-      white-space: nowrap;
+      display: flex;
+      flex: 0 0 auto;
 
-      &:not(.active) {
-        z-index: 4;
+      .tab {
+        width: 100%;
+        min-width: 1px;
+        position: relative;
+        border-bottom-left-radius: 0;
+        border-bottom-right-radius: 0;
+        padding: 6px 1em;
+        padding-bottom: 99px;
+        margin-bottom: 6px - 99px;
+        white-space: nowrap;
 
-        &:hover {
-          z-index: 6;
+        &:not(.active) {
+          z-index: 4;
+
+          &:hover {
+            z-index: 6;
+          }
         }
 
+        &.active {
+          background: transparent;
+          z-index: 5;
+        }
+      }
+
+      &:not(.active) {
         &::after {
           content: '';
           position: absolute;
           left: 0;
           right: 0;
-          top: 26px;
+          bottom: 0;
+          z-index: 7;
           border-bottom: 1px solid;
           border-bottom-color: $fallback--border;
           border-bottom-color: var(--border, $fallback--border);
         }
       }
-
-      &.active {
-        background: transparent;
-        border-bottom: none;
-        z-index: 5;
-      }
     }
+
   }
 }
-- 
cgit v1.2.3-70-g09d2

