diff --git a/README.md b/README.md index c797449..f198961 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,2 @@ # components -Some components used by @zen-browser and @Floorp-Projects as an attempt to make firefox forks a better place - -## Example usage - -```js -import("chrome://../browser-splitViews.mjs").then( - ({ SplitViews }) => { - window.gSplitView = new SplitViews({ - splitIndicator: "zen-splitted", - browserName: "zen", - defaultSplitView: "grid", - }); - } -); -``` \ No newline at end of file +Some components used by @zen-browser as an attempt to make firefox forks a better place diff --git a/src/browser-splitViews.mjs b/src/browser-splitViews.mjs index 6cb9684..64f7ed8 100644 --- a/src/browser-splitViews.mjs +++ b/src/browser-splitViews.mjs @@ -1,5 +1,14 @@ -class SplitViewsBase { +class SplitViewsUtils { + get tabBrowser() { + if (!this._tabBrowser) { + this._tabBrowser = document.getElementById('tabbrowser-tabpanels'); + } + return this._tabBrowser; + } +} + +class SplitViewsBase extends SplitViewsUtils { /** * @type {SplitView[]} */ @@ -9,6 +18,7 @@ class SplitViewsBase { * @param {SplitViewConfig} config */ constructor(config) { + super(); this.config = config; this.data = []; this.currentView = -1; @@ -90,7 +100,7 @@ class SplitViewsBase { if (!view) { return; } - // TODO: Update tab DOM here + } /**