Toggling data structures with arrows only, not body
This commit is contained in:
parent
49095dcfe3
commit
910483dd53
|
@ -456,13 +456,9 @@
|
||||||
color: #8f8f8f;
|
color: #8f8f8f;
|
||||||
content: "}";
|
content: "}";
|
||||||
}
|
}
|
||||||
#--re-frame-trace-- .re-frame-trace--object:before {
|
#--re-frame-trace-- .re-frame-trace--object .toggle {
|
||||||
color: #8f8f8f;
|
color: #8f8f8f;
|
||||||
content: "▶ ";
|
cursor: pointer;
|
||||||
}
|
|
||||||
#--re-frame-trace-- .re-frame-trace--object.expanded:before {
|
|
||||||
color: #8f8f8f;
|
|
||||||
content: "▼ ";
|
|
||||||
}
|
}
|
||||||
#--re-frame-trace-- .re-frame-trace--object > span {
|
#--re-frame-trace-- .re-frame-trace--object > span {
|
||||||
vertical-align: text-top;
|
vertical-align: text-top;
|
||||||
|
|
|
@ -575,14 +575,23 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.re-frame-trace--object {
|
.re-frame-trace--object {
|
||||||
&:before {
|
.toggle {
|
||||||
color: @text-color-muted;
|
color: @text-color-muted;
|
||||||
content: "▶ ";
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
&.expanded {
|
&>span {
|
||||||
|
vertical-align: text-top;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.data-structure-editable {
|
||||||
|
&.string {
|
||||||
&:before {
|
&:before {
|
||||||
color: @text-color-muted;
|
color: @text-color-muted;
|
||||||
content: "▼ ";
|
content: "\"";
|
||||||
|
}
|
||||||
|
&:after {
|
||||||
|
color: @text-color-muted;
|
||||||
|
content: "\"";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,13 +22,15 @@
|
||||||
|
|
||||||
(defn data-structure
|
(defn data-structure
|
||||||
[jsonml]
|
[jsonml]
|
||||||
(let [expand? (r/atom true)]
|
(let [expanded? (r/atom true)]
|
||||||
(fn [jsonml]
|
(fn [jsonml]
|
||||||
[:span
|
[:span
|
||||||
{:class (str/join " " ["re-frame-trace--object"
|
{:class (str/join " " ["re-frame-trace--object"
|
||||||
(when @expand? "expanded")])
|
(when @expanded? "expanded")])}
|
||||||
:on-click #(swap! expand? not)}
|
[:span {:class "toggle"
|
||||||
(jsonml->hiccup (if @expand?
|
:on-click #(swap! expanded? not)}
|
||||||
|
(if @expanded? "▼" "▶")]
|
||||||
|
(jsonml->hiccup (if @expanded?
|
||||||
(cljs-devtools/body-api-call
|
(cljs-devtools/body-api-call
|
||||||
(.-object (get jsonml 1))
|
(.-object (get jsonml 1))
|
||||||
(.-config (get jsonml 1)))
|
(.-config (get jsonml 1)))
|
||||||
|
|
Loading…
Reference in New Issue