[touchmenu] simplify code and finish early (#14113)

This commit is contained in:
zwim
2025-07-30 16:29:36 +02:00
committed by GitHub
parent a674bc8510
commit 400c774bcc
5 changed files with 67 additions and 81 deletions

View File

@@ -152,7 +152,7 @@ function IconButton:onHoldIconButton()
self.hold_callback()
elseif self.hold_input then
self:onInput(self.hold_input)
elseif type(self.hold_input_func) == "function" then
elseif self.hold_input_func then
self:onInput(self.hold_input_func())
elseif not self.hold_callback then -- nil or false
return