mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 14:25:30 +02:00
refactor: Update splitViews module and split-views configuration
This commit is contained in:
parent
f5f5f4b9c1
commit
edfd563927
2 changed files with 13 additions and 17 deletions
16
README.md
16
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",
|
||||
});
|
||||
}
|
||||
);
|
||||
```
|
||||
Some components used by @zen-browser as an attempt to make firefox forks a better place
|
||||
|
|
|
@ -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
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue