Open nlaplante opened 7 years ago
this seems to work
diff --git a/lib/atom-tabs-in-sidebar.js b/lib/atom-tabs-in-sidebar.js
index 4b89011..cb9698d 100644
--- a/lib/atom-tabs-in-sidebar.js
+++ b/lib/atom-tabs-in-sidebar.js
@@ -45,14 +45,14 @@ export default {
},
isTabBarActive(tabBar) {
- return tabBar.classList.contains(this.activeClass);
+ return tabBar.element.classList.contains(this.activeClass);
},
moveTabBarToSidebar(tabBar) {
if (!this.treeView) return;
if (this.isTabBarActive(tabBar)) return;
- tabBar.classList.add(this.activeClass);
- this.treeView.scroller.prepend(tabBar);
+ tabBar.element.classList.add(this.activeClass);
+ this.treeView.element.prepend(tabBar.element);
},
moveTabBarBack(tabBar) {
forgot to test toggle. this should fix that too.
diff --git a/lib/atom-tabs-in-sidebar.js b/lib/atom-tabs-in-sidebar.js
index 4b89011..df0a1ab 100644
--- a/lib/atom-tabs-in-sidebar.js
+++ b/lib/atom-tabs-in-sidebar.js
@@ -21,7 +21,7 @@ export default {
this.treeView = TreeView.treeView;
this.tabBars = Tabs.tabBarViews;
this.tabBars.forEach(tabBar => {
- tabBar._atomTabsInSidebar_originalParent = tabBar.parentNode;
+ tabBar._atomTabsInSidebar_originalParent = tabBar.element.parentNode;
this.moveTabBarToSidebar(tabBar);
});
});
@@ -45,21 +45,21 @@ export default {
},
isTabBarActive(tabBar) {
- return tabBar.classList.contains(this.activeClass);
+ return tabBar.element.classList.contains(this.activeClass);
},
moveTabBarToSidebar(tabBar) {
if (!this.treeView) return;
if (this.isTabBarActive(tabBar)) return;
- tabBar.classList.add(this.activeClass);
- this.treeView.scroller.prepend(tabBar);
+ tabBar.element.classList.add(this.activeClass);
+ this.treeView.element.prepend(tabBar.element);
},
moveTabBarBack(tabBar) {
let originalParent = tabBar._atomTabsInSidebar_originalParent;
if (!originalParent) return;
if (!this.isTabBarActive(tabBar)) return;
- tabBar.classList.remove(this.activeClass);
- originalParent.insertBefore(tabBar, originalParent.firstChild);
+ tabBar.element.classList.remove(this.activeClass);
+ originalParent.insertBefore(tabBar.element, originalParent.firstChild);
}
};
Already created PR, but seems your is better one, I did this.treeView.element.childNodes[0].prepend(tabBar.element);
instead of this.treeView.element.prepend(tabBar.element);
which caused shift of tab titles.
Now I understood why I was wrong 😁. So I put tabBar.element inside tree view
Fixed according to your patch. https://github.com/dbkaplun/atom-tabs-in-sidebar/pull/3/files
[Enter steps to reproduce:]
Atom: 1.14.0-beta3 x64 Electron: 1.3.13 OS: Microsoft Windows 10 Pro Thrown From: atom-tabs-in-sidebar package 1.1.0
Stack Trace
Uncaught TypeError: Cannot read property 'contains' of undefined
Commands
Non-Core Packages