From 160e763e0d507578e51d8cf7f948d0277db00cf3 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sat, 24 Feb 2018 16:12:25 -0800 Subject: [PATCH] simplify click delegates --- routes/_components/IconButton.html | 6 ++---- routes/_components/status/Status.html | 11 ++++------- routes/_components/status/StatusToolbar.html | 8 +++----- routes/_utils/delegate.js | 20 +++++++------------- 4 files changed, 16 insertions(+), 29 deletions(-) diff --git a/routes/_components/IconButton.html b/routes/_components/IconButton.html index 7489389..c47e6ea 100644 --- a/routes/_components/IconButton.html +++ b/routes/_components/IconButton.html @@ -4,8 +4,7 @@ aria-pressed="{{!!pressed}}" class="{{computedClass}}" disabled="{{disabled}}" - delegate-click-key="{{delegateKey}}" - delegate-keydown-key="{{delegateKey}}" + delegate-key="{{delegateKey}}" on:click > @@ -17,8 +16,7 @@ aria-label="{{label}}" class="{{computedClass}}" disabled="{{disabled}}" - delegate-click-key="{{delegateKey}}" - delegate-keydown-key="{{delegateKey}}" + delegate-key="{{delegateKey}}" on:click > diff --git a/routes/_components/status/Status.html b/routes/_components/status/Status.html index 4ad5260..c2654a1 100644 --- a/routes/_components/status/Status.html +++ b/routes/_components/status/Status.html @@ -1,7 +1,6 @@
is clickable in this case - registerDelegate('click', elementKey, onClickOrKeydown) - registerDelegate('keydown', elementKey, onClickOrKeydown) + registerClickDelegate(elementKey, onClickOrKeydown) } }, ondestroy() { let elementKey = this.get('elementKey') if (!this.get('isStatusInOwnThread')) { - unregisterDelegate('click', elementKey) - unregisterDelegate('keydown', elementKey) + unregisterClickDelegate(elementKey) } }, components: { diff --git a/routes/_components/status/StatusToolbar.html b/routes/_components/status/StatusToolbar.html index 9a0d6dc..436fb23 100644 --- a/routes/_components/status/StatusToolbar.html +++ b/routes/_components/status/StatusToolbar.html @@ -36,7 +36,7 @@