mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 19:14: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 {
|
||||
"ignore": () => {
|
||||
return false
|
||||
},
|
||||
"postCard-context": (parent, element, control) => {
|
||||
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
|
||||
items = items.map((item, index) => {
|
||||
if (!item.index) {
|
||||
@ -104,13 +108,20 @@ export default class ContextMenuCore extends Core {
|
||||
return
|
||||
}
|
||||
|
||||
const items = this.generateItems(component)
|
||||
|
||||
if (!items) {
|
||||
console.warn("No context menu items found, aborting")
|
||||
return false
|
||||
}
|
||||
|
||||
this.show({
|
||||
cords: {
|
||||
x,
|
||||
y,
|
||||
},
|
||||
clickedComponent: component,
|
||||
items: this.generateItems(component),
|
||||
items: items,
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user