Added onChange which calls observe (to keep the standard)

This commit is contained in:
Robert Jelic
2025-02-25 23:40:42 +01:00
parent b9ed68644a
commit 01d73edae6

View File

@@ -216,6 +216,16 @@ function BaseElement:handleEvent(event, ...)
return false
end
--- Observes a property and calls a callback when it changes
--- @shortDescription Observes a property and calls a callback when it changes
--- @param property string The property to observe
--- @param callback function The callback to call when the property changes
--- @return table self The BaseElement instance
function BaseElement:onChange(property, callback)
self:observe(property, callback)
return self
end
--- Returns the base frame of the element
--- @shortDescription Returns the base frame of the element
--- @return table BaseFrame The base frame of the element