3
0
mirror of https://github.com/britzl/monarch.git synced 2025-09-27 18:12:22 +02:00

Include transition id in TRANSITION.DONE message

Also send the TRANSITION.DONE message to the gui that was transitioned
This commit is contained in:
Björn Ritzl
2018-06-01 08:43:08 +02:00
parent 39628b75af
commit 724713f9e4
2 changed files with 10 additions and 3 deletions

View File

@@ -113,16 +113,18 @@ function M.create(node)
}
end
local function start_transition(transition, url)
local function start_transition(transition, transition_id, url)
table.insert(transition.urls, url)
if not transition.in_progress then
table.insert(transition.urls, msg.url())
current_transition = transition
transition.in_progress = true
transition.fn(node, initial_data, transition.easing, transition.duration, transition.delay or 0, function()
transition.in_progress = false
local message = { transition = transition_id }
while #transition.urls > 0 do
local url = table.remove(transition.urls)
msg.post(url, monarch.TRANSITION.DONE)
msg.post(url, monarch.TRANSITION.DONE, message)
end
end)
end
@@ -141,7 +143,7 @@ function M.create(node)
else
local transition = transitions[message_id]
if transition then
start_transition(transition, sender)
start_transition(transition, message_id, sender)
end
end
end