Add toggle arrow indicators next to expandable objects

This commit is contained in:
chris (daiyi) 2017-09-19 21:45:31 +02:00 committed by Daniel Compton
parent 5a832abab4
commit ea2f3d6dab
3 changed files with 14 additions and 3 deletions

View File

@ -460,6 +460,10 @@
color: #8f8f8f;
content: "▶ ";
}
#--re-frame-trace-- .re-frame-trace--object.expanded:before {
color: #8f8f8f;
content: "▼ ";
}
#--re-frame-trace-- .re-frame-trace--object > span {
vertical-align: text-top;
}

View File

@ -579,7 +579,12 @@
color: @text-color-muted;
content: "▶ ";
}
// display: block;
&.expanded {
&:before {
color: @text-color-muted;
content: "▼ ";
}
}
&>span {
vertical-align: text-top;

View File

@ -23,8 +23,10 @@
[jsonml]
(let [expand? (r/atom true)]
(fn []
[:span.re-frame-trace--object
{:on-click #(swap! expand? not)}
[:span
{:class (str/join " " ["re-frame-trace--object"
(when @expand? "expanded")])
:on-click #(swap! expand? not)}
(jsonml->hiccup (if @expand?
(cljs-devtools/body-api-call
(.-object (get jsonml 1))