 
     matched
 
+  handleJQueryCommandEvent: (event) =>
+    @handleCommandEvent(event) unless event.originalEvent?.__handledByCommandRegistry
+
+  addCommandListener: (node, commandName, listener) ->
+    node?.addEventListener(commandName, @handleCommandEvent, true)
+    $(node).on commandName, @handleJQueryCommandEvent
+
+  removeCommandListener: (node, commandName) ->
+    node?.removeEventListener(commandName, @handleCommandEvent, true)
+    $(node).off commandName, @handleJQueryCommandEvent
+
 class CommandListener
   enabled: true
 

      listenersForCommand.splice(listenersForCommand.indexOf(listener), 1)
      if listenersForCommand.length is 0
        delete @listenersByCommandName[commandName]
        @rootNode.removeEventListener(commandName, @handleCommandEvent, true)

  # Public: Find all registered commands matching a query.
  #

    @rootNode = newRootNode

    for commandName of @listenersByCommandName
      @removeCommandListener(oldRootNode, commandName)
      @addCommandListener(newRootNode, commandName)

  # Public: Add one or more command listeners associated with a selector.
  #
