adjust children for parent padding and margin

This commit is contained in:
airstruck
2015-10-25 16:01:41 -04:00
parent 8f604fb79d
commit 995825b9b3
11 changed files with 108 additions and 84 deletions

View File

@@ -1,6 +1,7 @@
local ROOT = (...):gsub('[^.]*$', '')
local Base = require(ROOT .. 'base')
local Hooker = require(ROOT .. 'hooker')
local Event = Base:extend({ name = 'Event' })
@@ -10,19 +11,14 @@ function Event:emit (observer, data, defaultAction)
if defaultAction then defaultAction() end
return
end
for i, callback in ipairs(callbacks) do
local result = callback(data or {})
if result ~= nil then return result end
end
local result = callbacks(data or {})
if result ~= nil then return result end
if defaultAction then defaultAction() end
end
function Event:bind (observer, callback)
local registry = self.registry
if not registry[observer] then
registry[observer] = {}
end
table.insert(registry[observer], callback)
return Hooker.hook(registry, observer, callback)
end
local eventNames = {