mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-12 12:04:16 +00:00
handle ignore
context menu
This commit is contained in:
parent
88d868cce5
commit
cfd6d75408
@ -11,6 +11,9 @@ function copyToClipboard(text) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
"ignore": () => {
|
||||||
|
return false
|
||||||
|
},
|
||||||
"postCard-context": (parent, element, control) => {
|
"postCard-context": (parent, element, control) => {
|
||||||
const items = [
|
const items = [
|
||||||
{
|
{
|
||||||
|
@ -66,6 +66,10 @@ export default class ContextMenuCore extends Core {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!items) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
// fullfill each item with a correspondent index if missing declared
|
// fullfill each item with a correspondent index if missing declared
|
||||||
items = items.map((item, index) => {
|
items = items.map((item, index) => {
|
||||||
if (!item.index) {
|
if (!item.index) {
|
||||||
@ -104,13 +108,20 @@ export default class ContextMenuCore extends Core {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const items = this.generateItems(component)
|
||||||
|
|
||||||
|
if (!items) {
|
||||||
|
console.warn("No context menu items found, aborting")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
this.show({
|
this.show({
|
||||||
cords: {
|
cords: {
|
||||||
x,
|
x,
|
||||||
y,
|
y,
|
||||||
},
|
},
|
||||||
clickedComponent: component,
|
clickedComponent: component,
|
||||||
items: this.generateItems(component),
|
items: items,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user