mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 15:36:02 +01:00
fix(client/context): hide before triggering select actions
This commit is contained in:
@@ -32,6 +32,8 @@ local function closeContext(_, cb, onExit)
|
|||||||
|
|
||||||
lib.resetNuiFocus()
|
lib.resetNuiFocus()
|
||||||
|
|
||||||
|
if not openContextMenu then return end
|
||||||
|
|
||||||
if (cb or onExit) and contextMenus[openContextMenu].onExit then contextMenus[openContextMenu].onExit() end
|
if (cb or onExit) and contextMenus[openContextMenu].onExit then contextMenus[openContextMenu].onExit() end
|
||||||
|
|
||||||
if not cb then SendNUIMessage({ action = 'hideContext' }) end
|
if not cb then SendNUIMessage({ action = 'hideContext' }) end
|
||||||
@@ -98,15 +100,11 @@ RegisterNUICallback('clickContext', function(id, cb)
|
|||||||
|
|
||||||
openContextMenu = nil
|
openContextMenu = nil
|
||||||
|
|
||||||
lib.resetNuiFocus()
|
SendNUIMessage({ action = 'hideContext' })
|
||||||
|
|
||||||
if data.onSelect then data.onSelect(data.args) end
|
if data.onSelect then data.onSelect(data.args) end
|
||||||
if data.event then TriggerEvent(data.event, data.args) end
|
if data.event then TriggerEvent(data.event, data.args) end
|
||||||
if data.serverEvent then TriggerServerEvent(data.serverEvent, data.args) end
|
if data.serverEvent then TriggerServerEvent(data.serverEvent, data.args) end
|
||||||
|
|
||||||
SendNUIMessage({
|
|
||||||
action = 'hideContext'
|
|
||||||
})
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNUICallback('closeContext', closeContext)
|
RegisterNUICallback('closeContext', closeContext)
|
||||||
|
|||||||
Reference in New Issue
Block a user