Merge remote-tracking branch 'blueyed/awful-rules-optional-callback'
This commit is contained in:
commit
afa50904fb
|
@ -197,7 +197,7 @@ end
|
||||||
--- Apply properties and callbacks to a client.
|
--- Apply properties and callbacks to a client.
|
||||||
-- @param c The client.
|
-- @param c The client.
|
||||||
-- @param props Properties to apply.
|
-- @param props Properties to apply.
|
||||||
-- @param callbacks Callbacks to apply.
|
-- @param callbacks Callbacks to apply (optional).
|
||||||
function rules.execute(c, props, callbacks)
|
function rules.execute(c, props, callbacks)
|
||||||
for property, value in pairs(props) do
|
for property, value in pairs(props) do
|
||||||
if property ~= "focus" and type(value) == "function" then
|
if property ~= "focus" and type(value) == "function" then
|
||||||
|
@ -230,9 +230,11 @@ function rules.execute(c, props, callbacks)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Apply all callbacks.
|
-- Apply all callbacks.
|
||||||
|
if callbacks then
|
||||||
for i, callback in pairs(callbacks) do
|
for i, callback in pairs(callbacks) do
|
||||||
callback(c)
|
callback(c)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Do this at last so we do not erase things done by the focus
|
-- Do this at last so we do not erase things done by the focus
|
||||||
-- signal.
|
-- signal.
|
||||||
|
|
Loading…
Reference in New Issue