feat: context menu (#3180)
Co-authored-by: Liyas Thomas <liyascthomas@gmail.com>
This commit is contained in:
@@ -84,6 +84,13 @@
|
||||
:show="savingRequest"
|
||||
@hide-modal="onSaveModalClose"
|
||||
/>
|
||||
<AppContextMenu
|
||||
v-if="contextMenu.show"
|
||||
:show="contextMenu.show"
|
||||
:position="contextMenu.position"
|
||||
:text="contextMenu.text"
|
||||
@hide-modal="contextMenu.show = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -138,6 +145,24 @@ const reqName = ref<string>("")
|
||||
const t = useI18n()
|
||||
const toast = useToast()
|
||||
|
||||
type PopupDetails = {
|
||||
show: boolean
|
||||
position: {
|
||||
top: number
|
||||
left: number
|
||||
}
|
||||
text: string | null
|
||||
}
|
||||
|
||||
const contextMenu = ref<PopupDetails>({
|
||||
show: false,
|
||||
position: {
|
||||
top: 0,
|
||||
left: 0,
|
||||
},
|
||||
text: null,
|
||||
})
|
||||
|
||||
const tabs = getActiveTabs()
|
||||
|
||||
const confirmSync = useReadonlyStream(currentSyncingStatus$, {
|
||||
@@ -365,6 +390,22 @@ function oAuthURL() {
|
||||
})
|
||||
}
|
||||
|
||||
defineActionHandler("contextmenu.open", ({ position, text }) => {
|
||||
if (text) {
|
||||
contextMenu.value = {
|
||||
show: true,
|
||||
position,
|
||||
text,
|
||||
}
|
||||
} else {
|
||||
contextMenu.value = {
|
||||
show: false,
|
||||
position,
|
||||
text,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
setupTabStateSync()
|
||||
bindRequestToURLParams()
|
||||
oAuthURL()
|
||||
|
||||
Reference in New Issue
Block a user