refactor: Update splitViews module and split-views configuration

This commit is contained in:
Mauro Balades 2024-08-06 15:57:10 +02:00
parent f5f5f4b9c1
commit edfd563927
2 changed files with 13 additions and 17 deletions

View file

@ -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",
});
}
);
```
Some components used by @zen-browser as an attempt to make firefox forks a better place

View file

@ -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
}
/**