diff --git a/[esx]/esx_menu_list/client/main.lua b/[esx]/esx_menu_list/client/main.lua index 9cd27f91..65721d0f 100644 --- a/[esx]/esx_menu_list/client/main.lua +++ b/[esx]/esx_menu_list/client/main.lua @@ -12,11 +12,7 @@ CreateThread(function() name = name, data = data }) - - ESX.SetTimeout(200, function() - SetNuiFocus(true, true) - end) - + SetNuiFocus(true, true) end local function closeMenu(namespace, name) @@ -46,11 +42,9 @@ CreateThread(function() RegisterNUICallback('menu_submit', function(data, cb) local menu = ESX.UI.Menu.GetOpened(MenuType, data._namespace, data._name) - - if menu.submit ~= nil then + if menu.submit then menu.submit(data, menu) end - cb('OK') end) diff --git a/[esx]/esx_menu_list/html/js/app.js b/[esx]/esx_menu_list/html/js/app.js index 943e2db8..fd113858 100644 --- a/[esx]/esx_menu_list/html/js/app.js +++ b/[esx]/esx_menu_list/html/js/app.js @@ -122,6 +122,7 @@ let menu = $(Mustache.render(MenuTpl, view)); menu.find('button[data-namespace][data-name]').click(function() { + ESX_MENU.data[$(this).data('namespace')][$(this).data('name')][parseInt($(this).data('id'))].currentRow = parseInt($(this).data('id')) + 1; ESX_MENU.submit($(this).data('namespace'), $(this).data('name'), { data : ESX_MENU.data[$(this).data('namespace')][$(this).data('name')][parseInt($(this).data('id'))], value: $(this).data('value')