Rename the "clicked" event to "click" in Tray
This commit is contained in:
parent
52f1431bde
commit
e8ffd24e4e
5 changed files with 26 additions and 17 deletions
|
@ -42,12 +42,15 @@ deprecate.property = (object, property, method) ->
|
|||
# Deprecate an event.
|
||||
deprecate.event = (emitter, oldName, newName, fn) ->
|
||||
warned = false
|
||||
emitter.on newName, ->
|
||||
emitter.on newName, (args...) ->
|
||||
if @listenerCount(oldName) > 0 # there is listeners for old API.
|
||||
unless warned or process.noDeprecation
|
||||
warned = true
|
||||
deprecate.warn "'#{oldName}' event", "'#{newName}' event"
|
||||
fn.apply this, arguments
|
||||
if fn?
|
||||
fn.apply this, arguments
|
||||
else
|
||||
@emit oldName, args...
|
||||
|
||||
# Print deprecate warning.
|
||||
deprecate.warn = (oldName, newName) ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue