mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 07:06:00 +00:00
tool strip button, execute current command
This commit is contained in:
23
packages/web/src/buttons/ToolStripSplitDropDownButton.svelte
Normal file
23
packages/web/src/buttons/ToolStripSplitDropDownButton.svelte
Normal file
@@ -0,0 +1,23 @@
|
||||
<script lang="ts">
|
||||
import { currentDropDownMenu } from '../stores';
|
||||
|
||||
import ToolStripButton from './ToolStripButton.svelte';
|
||||
import ToolStripSplitButton from './ToolStripSplitButton.svelte';
|
||||
|
||||
export let menu;
|
||||
export let title = undefined;
|
||||
export let label;
|
||||
export let icon;
|
||||
export let component = ToolStripButton;
|
||||
|
||||
function handleClick(e) {
|
||||
const rect = e.detail.target.getBoundingClientRect();
|
||||
const left = rect.left;
|
||||
const top = rect.bottom;
|
||||
currentDropDownMenu.set({ left, top, items: menu });
|
||||
}
|
||||
</script>
|
||||
|
||||
<ToolStripSplitButton {title} {icon} on:splitclick={handleClick} on:click>
|
||||
<slot />
|
||||
</ToolStripSplitButton>
|
||||
Reference in New Issue
Block a user