Merge pull request #9794 from htlxyz/v3_origin

modify event register function name
This commit is contained in:
minggo 2015-01-05 14:22:53 +08:00
commit 4b2375e28c
1 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ function Event:unbind(target)
self:init_()
end
function Event:onEventListener(eventName, listener, tag)
function Event:on(eventName, listener, tag)
assert(type(eventName) == "string" and eventName ~= "",
"Event:addEventListener() - invalid eventName")
eventName = string.upper(eventName)
@ -50,7 +50,7 @@ function Event:onEventListener(eventName, listener, tag)
return self.target_, handle
end
Event.addEventListener = Event.onEventListener
Event.addEventListener = Event.on
function Event:dispatchEvent(event)
event.name = string.upper(tostring(event.name))