File tree Expand file tree Collapse file tree 2 files changed +9
-17
lines changed Expand file tree Collapse file tree 2 files changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -4,18 +4,12 @@ import { Tabs, Tab } from "./components/TabStrip";
44import { Omnibox } from "./components/Omnibox" ;
55import { scramjet } from "./main" ;
66import iconAdd from "@ktibow/iconset-ion/add" ;
7- import { popTab , pushTab , Shell } from "./components/Shell" ;
7+ import { Shell } from "./components/Shell" ;
88import { createMenu } from "./components/Menu" ;
9+ import { createDelegate } from "./delegate" ;
910
10- // let a = createState({
11- // b: createState({
12- // c: "test",
13- // }),
14- // });
15- // use(a.b.c).listen((v) => {
16- // console.log("a.b.c changed to", v);
17- // });
18- // a.b.c = "test2";
11+ export const pushTab = createDelegate < Tab > ( ) ;
12+ export const popTab = createDelegate < Tab > ( ) ;
1913
2014class StatefulClass {
2115 constructor ( state : Stateful < any > ) {
Original file line number Diff line number Diff line change 11import type { Component } from "dreamland/core" ;
22import type { Tab } from "./TabStrip" ;
33import { browser } from "../main" ;
4-
5- export let pushTab : ( tab : Tab ) => void ;
6- export let popTab : ( tab : Tab ) => void ;
4+ import { popTab , pushTab } from "../browser" ;
75
86export const Shell : Component < {
97 tabs : Tab [ ] ;
108 activetab : Tab ;
119} > = function ( cx ) {
12- pushTab = ( tab ) => {
10+ pushTab . listen ( ( tab ) => {
1311 tab . frame . frame . classList . add ( cx . id ) ;
1412 cx . root . appendChild (
1513 < div
@@ -19,15 +17,15 @@ export const Shell: Component<{
1917 { tab . frame . frame }
2018 </ div >
2119 ) ;
22- } ;
23- popTab = ( tab ) => {
20+ } ) ;
21+ popTab . listen ( ( tab ) => {
2422 for ( let el of cx . root . children ) {
2523 if ( el . children [ 0 ] == tab . frame . frame ) {
2624 el . remove ( ) ;
2725 break ;
2826 }
2927 }
30- } ;
28+ } ) ;
3129
3230 return < div class :unfocus = { use ( browser . unfocusframes ) } > </ div > ;
3331} ;
You can’t perform that action at this time.
0 commit comments