mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
feat(context): prevent event triggering (#34)
This commit is contained in:
@@ -13,7 +13,7 @@ function lib.showContext(id)
|
||||
menu = data.menu,
|
||||
options = data.options
|
||||
}
|
||||
}, {sort_keys=true}))
|
||||
}, { sort_keys = true }))
|
||||
end
|
||||
|
||||
function lib.registerContext(context)
|
||||
@@ -34,11 +34,13 @@ RegisterNUICallback('openContext', function(id, cb)
|
||||
lib.showContext(id)
|
||||
end)
|
||||
|
||||
RegisterNUICallback('clickContext', function(data, cb)
|
||||
RegisterNUICallback('clickContext', function(id, cb)
|
||||
cb(1)
|
||||
SetNuiFocus(false, false)
|
||||
local data = contextMenus[openContextMenu].options[id]
|
||||
if data.event then TriggerEvent(data.event, data.args) end
|
||||
if data.serverEvent then TriggerServerEvent(data.serverEvent, data.args) end
|
||||
|
||||
openContextMenu = nil
|
||||
SendNUIMessage({
|
||||
action = 'hideContext'
|
||||
|
||||
Reference in New Issue
Block a user