Commit Graph

28 Commits

Author SHA1 Message Date
Willem Van Lint
73748ef768 Order listeners by reverse registration order 2016-05-01 16:48:09 -07:00
Max Brunsfeld
5c545c0898 Don't register CommandRegistry's window listeners in AtomEnvironment constructor 2015-10-08 17:34:41 -07:00
Nathan Sobo
ccfa36d1b1 Preserve all event properties when dispatching commands
Fixes https://github.com/atom/vim-mode/issues/863
Fixes https://github.com/atom/atom/issues/8845

---

Re-applying this commit because it was accidentally merged from stable to
beta and master with `--strategy ours` (discarding the changes) instead of
`-X ours` (discarding conflicting changes).

Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
2015-09-18 15:53:44 -07:00
Max Brunsfeld
5c73e5a001 Add CommandRegistry::onDidDispatch 2015-08-24 14:10:02 -07:00
Ivan Zuzak
326457d21b Add test for object target case 2015-06-22 18:55:08 +02:00
Ivan Zuzak
6521c869c4 Failing test to demonstrate problem 2015-06-22 07:56:21 +02:00
Kevin Sawicki
8ba098b640 Throw an error when adding an invalid selector 2015-03-04 10:02:03 -08:00
Nathan Sobo
832e7113f7 Include all inline commands on the bubble path in ::findCommands 2014-11-10 10:10:52 -07:00
Max Brunsfeld
0c40a1ef92 Include inline commands in command palette 2014-11-10 10:09:24 -07:00
Nathan Sobo
2d7aa2efda Forward .abortKeyBinding() on CommandRegistry events to original event 2014-10-08 12:13:13 -07:00
Nathan Sobo
cdb4ed1327 Integrate jQuery::on and ::trigger with command registry dispatch 2014-10-08 11:56:50 -07:00
Nathan Sobo
0d55a377fb Support inline listeners
This extends the command registry to support listeners registered on
individual elements in addition to selectors. The analogy is inline
styles vs selector-based styles. I’m hoping this will be the foundation
of integrating cleanly with legacy commands registered via our
jQuery::command extension.
2014-10-08 11:56:50 -07:00
Nathan Sobo
2084c45404 💄 spec description 2014-10-08 11:56:50 -07:00
Nathan Sobo
066f6bf03c Forward stop[Immediate]Propagation to original event in CommandRegistry
Previously, stopping propagation would work on the synthetic bubbling
phase of the command registry itself, but the original event would
continue to propagate which is counterintuitive.
2014-09-24 14:34:28 -06:00
Nathan Sobo
2df5957f9b Restore commands after each spec
This commit adds the ability to get and restore snapshots of command
listeners. Whatever commands are installed before specs begin are
preserved, but commands added during specs are always cleared away.
2014-09-24 14:34:28 -06:00
Nathan Sobo
09b5ac887a Return whether a dispatched command matched a listener 2014-09-24 14:34:28 -06:00
Nathan Sobo
0c9fd46030 Add CommandRegistry::dispatch for tests 2014-09-24 14:34:27 -06:00
Nathan Sobo
a069f34ad6 Fix CommandRegistry::findCommands spec
Don’t assert against commands registered on the window with jQuery
2014-09-16 09:23:52 -06:00
Nathan Sobo
3e0e19d51b Add CommandRegistry::findCommands 2014-09-11 13:48:35 -06:00
Nathan Sobo
155fb675ec 💄 group dispatch specs 2014-09-11 13:48:35 -06:00
Nathan Sobo
43d3082d4e Allow multiple commands to be registered by passing an object 2014-09-11 13:48:35 -06:00
Nathan Sobo
aee33fc126 Pass selector first to CommandRegistry::add 2014-09-11 13:48:35 -06:00
Nathan Sobo
4de0865d28 Allow listeners to be removed via a Disposable returned from ::add 2014-09-11 13:48:34 -06:00
Nathan Sobo
fe27ebec1b Handle .stopImmediatePropagation() being called on command events 2014-09-11 13:48:34 -06:00
Nathan Sobo
fbaf956e1f Handle .stopPropagation() being called on command events 2014-09-11 13:48:34 -06:00
Nathan Sobo
5eb22520f1 Order multiple matching listeners by selector specificity 2014-09-11 13:48:34 -06:00
Nathan Sobo
a075aa2b07 Perform synthetic bubbling through event target ancestors 2014-09-11 13:48:34 -06:00
Nathan Sobo
decc983420 Start on CommandRegistry 2014-09-11 13:48:34 -06:00