Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Mini-hist controls should be classed with "selected" when their metri…

…c is selected.
  • Loading branch information...
commit e781e8c41f31b41f676ce9b35dc0650585163443 1 parent 4bba17b
@lynaghk authored
Showing with 9 additions and 6 deletions.
  1. +7 −6 src/cljs/vcfvis/controls.cljs
  2. +2 −0  src/sass/_mini_metrics.sass
View
13 src/cljs/vcfvis/controls.cljs
@@ -32,13 +32,13 @@
(bind! "#metrics"
(let [shared (set (map :id @core/!shared-metrics))
selected-metric @core/!metric
- metrics (for [[id m] (@core/!context :metrics)]
- (assoc m :id id
- :selected? (= m selected-metric)
- :shared? (contains? shared id)))]
+ metrics (for [m (vals (@core/!context :metrics))]
+ (assoc m
+ :selected? (= m selected-metric)
+ :shared? (contains? shared (m :id))))]
[:div#metrics
(unify metrics
- (fn [{:keys [id desc selected? shared?]}]
+ (fn [{:keys [id desc selected? shared?]}]
[:div.metric {:id (str "metric-" id)
:class (str (when selected? "selected")
" " (when-not shared? "disabled"))}
@@ -46,7 +46,8 @@
[:span desc]
[:div.mini-hist]]))]))
-(event/on "#metrics" :click core/select-metric!)
+(event/on "#metrics" :click
+ (fn [d] (core/select-metric! (dissoc d :selected? :shared?))))
View
2  src/sass/_mini_metrics.sass
@@ -11,3 +11,5 @@
.mini-hist
display: none
+.metric.selected
+ background-color: rgba(255,255,255, 0.5)
Please sign in to comment.
Something went wrong with that request. Please try again.