Use placeholder toggle for data objects

This commit is contained in:
chris (daiyi) 2017-09-16 12:19:29 +02:00 committed by Daniel Compton
parent fcd376b8a4
commit ed21d59ede
3 changed files with 25 additions and 12 deletions

View File

@ -456,3 +456,11 @@
color: #8f8f8f; color: #8f8f8f;
content: "}"; content: "}";
} }
#--re-frame-trace-- .re-frame-trace--object:before {
color: #8f8f8f;
content: "▶ ";
}
#--re-frame-trace-- .re-frame-trace--object:after {
color: #222222;
content: "{...}";
}

View File

@ -574,4 +574,14 @@
content: "}"; content: "}";
} }
} }
.re-frame-trace--object {
&:before {
color: @text-color-muted;
content: "▶ ";
}
&:after {
color: @text-color;
content: "{...}";
}
}
} }

View File

@ -32,20 +32,15 @@
(defn jsonml-style (defn jsonml-style
[style-map] [style-map]
; {:style (get style-map "style")} {:style {:background "rgba(0,0,0,0.04)"}})
{:style {:background "rgba(0,0,0,0.1)"}})
(defn str->hiccup (defn str->hiccup
[string] [string]
; (println string) (println string)
(cond (= string "span") :span (cond (= string "span") :span
(= string "style") :style (= string "style") :style
; (= string "}") nil (= string "object") :span.re-frame-trace--object
; (= string "{") nil :else string))
; (= string " ") nil
; (= string ", ") nil
:else string))
(defn crawl (defn crawl
[data] [data]
@ -63,5 +58,5 @@
(defn tab [data] (defn tab [data]
[:div {:style {:flex "1 0 auto" :width "100%" :height "100%" :display "flex" :flex-direction "column"}} [:div {:style {:flex "1 0 auto" :width "100%" :height "100%" :display "flex" :flex-direction "column"}}
[:div.panel-content-scrollable [:div.panel-content-scrollable
(jsonml->hiccup (js->clj (cljs-devtools/header-api-call data)))]]) (jsonml->hiccup (js->clj (cljs-devtools/header-api-call data) :keywordize-keys true))]])
; (crawl data)]]) ; (crawl data)]])