Skip to content

Commit 3e64406

Browse files
committed
[frontend] navigation buttons
1 parent 9251aae commit 3e64406

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

frontend/src/Omnibox.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ export const UrlInput: Component<
9090
this.value = item;
9191
this.active = false;
9292
this.input.blur();
93+
94+
this.navigate(this.value);
9395
}}
9496
class:focused={use(this.focusindex).map(
9597
(i) => i - 1 === this.overflowItems.indexOf(item)
@@ -232,12 +234,15 @@ IconButton.css = `
232234
export const Omnibox: Component<{
233235
value: string;
234236
navigate: (url: string) => void;
237+
goBack: () => void;
238+
goForwards: () => void;
239+
refresh: () => void;
235240
}> = function (cx) {
236241
return (
237242
<div>
238-
<IconButton icon={iconBack}></IconButton>
239-
<IconButton icon={iconForwards}></IconButton>
240-
<IconButton icon={iconRefresh}></IconButton>
243+
<IconButton click={this.goBack} icon={iconBack}></IconButton>
244+
<IconButton click={this.goForwards} icon={iconForwards}></IconButton>
245+
<IconButton click={this.refresh} icon={iconRefresh}></IconButton>
241246
<Spacer></Spacer>
242247
<UrlInput value={use(this.value)} navigate={this.navigate}></UrlInput>
243248
<Spacer></Spacer>

frontend/src/browser.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,15 @@ export class Browser extends StatefulClass {
247247
/>
248248
<Omnibox
249249
value={use(this.activetab.url)}
250+
goBack={() => {
251+
this.activetab.frame.back();
252+
}}
253+
goForwards={() => {
254+
this.activetab.frame.forward();
255+
}}
256+
refresh={() => {
257+
this.activetab.frame.reload();
258+
}}
250259
navigate={(url) => this.navigate(url)}
251260
/>
252261
{shell}

0 commit comments

Comments
 (0)