mirror of
https://github.com/airstruck/luigi.git
synced 2025-12-19 02:16:43 +00:00
add horizontal scrolling, fix #3
This commit is contained in:
@@ -417,8 +417,9 @@ function Layout:addDefaultHandlers ()
|
||||
createBehavior('scroll', {
|
||||
self:onWheelMove(function (event)
|
||||
if not event.hit then return end
|
||||
local amount = event.scrollY ~= 0 and event.scrollY or event.scrollX
|
||||
for widget in event.target:eachAncestor(true) do
|
||||
if widget:scrollBy(nil, event.y) then return false end
|
||||
if widget:scrollBy(amount) then return false end
|
||||
end -- ancestor loop
|
||||
return false
|
||||
end) -- wheel move
|
||||
|
||||
Reference in New Issue
Block a user