File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { css, type Component } from "dreamland/core";
22import { Icon } from "./Icon" ;
33import iconAdd from "@ktibow/iconset-ion/add" ;
44import { browser } from "../main" ;
5+ import { createMenu } from "./Menu" ;
56
67export const BookmarksStrip : Component = function ( ) {
78 return (
@@ -12,9 +13,33 @@ export const BookmarksStrip: Component = function () {
1213 </ button >
1314 { use ( browser . bookmarks ) . mapEach ( ( b ) => (
1415 < button
15- on :auxclick = { ( ) => {
16+ on :auxclick = { ( e : MouseEvent ) => {
17+ if ( e . button != 1 ) return ;
1618 browser . newTab ( new URL ( b . url ) ) ;
1719 } }
20+ on :contextmenu = { ( e : MouseEvent ) => {
21+ createMenu ( e . clientX , e . clientY , [
22+ {
23+ label : "Open" ,
24+ action : ( ) => browser . activetab . pushNavigate ( new URL ( b . url ) ) ,
25+ } ,
26+ {
27+ label : "Open in New Tab" ,
28+ action : ( ) => browser . newTab ( new URL ( b . url ) ) ,
29+ } ,
30+ {
31+ label : "Edit Bookmark" ,
32+ } ,
33+ {
34+ label : "Delete Bookmark" ,
35+ action : ( ) => {
36+ browser . bookmarks = browser . bookmarks . filter ( ( br ) => br != b ) ;
37+ } ,
38+ } ,
39+ ] ) ;
40+ e . preventDefault ( ) ;
41+ e . stopPropagation ( ) ;
42+ } }
1843 on :click = { ( ) => {
1944 browser . activetab . pushNavigate ( new URL ( b . url ) ) ;
2045 } }
You can’t perform that action at this time.
0 commit comments