From 48f17700d3415dfc20239f741221522dbd30f144 Mon Sep 17 00:00:00 2001 From: Daniel Compton Date: Fri, 25 Aug 2017 10:46:20 +1200 Subject: [PATCH] Improve behaviour of text filtering - Make only the text itself clickable - Stop propagation of the event any further, preventing the trace from also being toggled. --- src/day8/re_frame/trace.cljs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/day8/re_frame/trace.cljs b/src/day8/re_frame/trace.cljs index d13d9de..ef98c94 100644 --- a/src/day8/re_frame/trace.cljs +++ b/src/day8/re_frame/trace.cljs @@ -172,14 +172,18 @@ nil)}} [:td {:style row-style} [:button (if show-row? "▼" "▶")]] - [:td {:style row-style - :on-click #(save-query op-type)} + [:td {:style row-style} [:div.op-string - (str op-type)]] - [:td {:style row-style - :on-click #(save-query op-name)} + [:span {:on-click (fn [ev] + (save-query op-type) + (.stopPropagation ev)) + :style {:cursor "pointer"}} (str op-type)]]] + [:td {:style row-style} [:div.op-string - op-name]] + [:span {:on-click (fn [ev] + (save-query op-name) + (.stopPropagation ev)) + :style {:cursor "pointer"}}] op-name]] [:td {:style (merge row-style { ; :font-weight (if (< slower-than-bold-int duration)