fix timeline dropdowns
This commit is contained in:
parent
8c196d5cb2
commit
e37d726a94
3 changed files with 42 additions and 3 deletions
10
locales/index.d.ts
vendored
10
locales/index.d.ts
vendored
|
|
@ -13673,6 +13673,16 @@ export interface Locale extends ILocale {
|
||||||
* Background queue
|
* Background queue
|
||||||
*/
|
*/
|
||||||
"backgroundQueue": string;
|
"backgroundQueue": string;
|
||||||
|
"_header": {
|
||||||
|
/**
|
||||||
|
* Browse
|
||||||
|
*/
|
||||||
|
"browse": string;
|
||||||
|
/**
|
||||||
|
* Manage
|
||||||
|
*/
|
||||||
|
"manage": string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
declare const locales: {
|
declare const locales: {
|
||||||
[lang: string]: Locale;
|
[lang: string]: Locale;
|
||||||
|
|
|
||||||
|
|
@ -140,14 +140,28 @@ async function chooseList(ev: MouseEvent): Promise<void> {
|
||||||
(lists.length === 0 ? undefined : { type: 'divider' }),
|
(lists.length === 0 ? undefined : { type: 'divider' }),
|
||||||
{
|
{
|
||||||
type: 'link' as const,
|
type: 'link' as const,
|
||||||
|
icon: 'ti ti-pencil',
|
||||||
|
text: i18n.ts._header.manage,
|
||||||
|
to: '/my/lists',
|
||||||
|
},
|
||||||
|
{
|
||||||
icon: 'ti ti-plus',
|
icon: 'ti ti-plus',
|
||||||
text: i18n.ts.createNew,
|
text: i18n.ts.createNew,
|
||||||
to: '/my/lists',
|
action: createList,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function createList() {
|
||||||
|
const { canceled, result: name } = await os.inputText({
|
||||||
|
title: i18n.ts.enterListName,
|
||||||
|
});
|
||||||
|
if (canceled) return;
|
||||||
|
await os.apiWithDialog('users/lists/create', { name: name });
|
||||||
|
userListsCache.delete();
|
||||||
|
}
|
||||||
|
|
||||||
async function chooseAntenna(ev: MouseEvent): Promise<void> {
|
async function chooseAntenna(ev: MouseEvent): Promise<void> {
|
||||||
const antennas = await antennasCache.fetch();
|
const antennas = await antennasCache.fetch();
|
||||||
const items: MenuItem[] = [
|
const items: MenuItem[] = [
|
||||||
|
|
@ -158,11 +172,17 @@ async function chooseAntenna(ev: MouseEvent): Promise<void> {
|
||||||
to: `/timeline/antenna/${antenna.id}`,
|
to: `/timeline/antenna/${antenna.id}`,
|
||||||
})),
|
})),
|
||||||
(antennas.length === 0 ? undefined : { type: 'divider' }),
|
(antennas.length === 0 ? undefined : { type: 'divider' }),
|
||||||
|
{
|
||||||
|
type: 'link' as const,
|
||||||
|
icon: 'ti ti-pencil',
|
||||||
|
text: i18n.ts._header.manage,
|
||||||
|
to: '/my/antennas',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'link' as const,
|
type: 'link' as const,
|
||||||
icon: 'ti ti-plus',
|
icon: 'ti ti-plus',
|
||||||
text: i18n.ts.createNew,
|
text: i18n.ts.createNew,
|
||||||
to: '/my/antennas',
|
to: '/my/antennas/create',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
||||||
|
|
@ -183,11 +203,17 @@ async function chooseChannel(ev: MouseEvent): Promise<void> {
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
(channels.length === 0 ? undefined : { type: 'divider' }),
|
(channels.length === 0 ? undefined : { type: 'divider' }),
|
||||||
|
{
|
||||||
|
type: 'link',
|
||||||
|
icon: 'ti ti-search',
|
||||||
|
text: i18n.ts._header.browse,
|
||||||
|
to: '/channels',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'link',
|
type: 'link',
|
||||||
icon: 'ti ti-plus',
|
icon: 'ti ti-plus',
|
||||||
text: i18n.ts.createNew,
|
text: i18n.ts.createNew,
|
||||||
to: '/channels',
|
to: '/channels/new',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
||||||
|
|
|
||||||
|
|
@ -733,3 +733,6 @@ restartMigrationDescription: "Account migration was last attempted {date}. If th
|
||||||
restartMigrationConfirm: "Are you sure you want to restart this account migration?"
|
restartMigrationConfirm: "Are you sure you want to restart this account migration?"
|
||||||
|
|
||||||
backgroundQueue: "Background queue"
|
backgroundQueue: "Background queue"
|
||||||
|
_header:
|
||||||
|
browse: "Browse"
|
||||||
|
manage: "Manage"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue