Merge pull request #64 from Day8/feature/log-data-to-console
Print trace details to console on click
This commit is contained in:
commit
51069d5eb7
|
@ -43,6 +43,8 @@ If you are using leiningen, modify `project.clj` in the following ways. When puz
|
|||
:preloads [day8.re-frame.trace.preload]}}]}
|
||||
```
|
||||
|
||||
[cljs-devtools](https://github.com/binaryage/cljs-devtools) is not required to use re-frame-trace, but it is highly recommended.
|
||||
|
||||
## Usage
|
||||
|
||||
- Start up your application.
|
||||
|
|
|
@ -98,3 +98,6 @@
|
|||
#--re-frame-trace-- .filter-control {
|
||||
margin: 10px 0 0 10px;
|
||||
}
|
||||
#--re-frame-trace-- .trace-details {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
|
|
@ -105,4 +105,8 @@
|
|||
.filter-control {
|
||||
margin: 10px 0 0 10px;
|
||||
}
|
||||
.trace-details {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -199,11 +199,13 @@
|
|||
(.toFixed duration 1) " ms"]]
|
||||
(when show-row?
|
||||
[:tr {:key (str id "-details")}
|
||||
[:td {:col-span 3} (let [tag-str (with-out-str (pprint/pprint tags))
|
||||
string-size-limit 400]
|
||||
(if (< string-size-limit (count tag-str))
|
||||
(str (subs tag-str 0 string-size-limit) " ...")
|
||||
tag-str))]]))))))
|
||||
[:td.trace-details {:col-span 3
|
||||
:on-click #(.log js/console tags)}
|
||||
(let [tag-str (with-out-str (pprint/pprint tags))
|
||||
string-size-limit 400]
|
||||
(if (< string-size-limit (count tag-str))
|
||||
(str (subs tag-str 0 string-size-limit) " ...")
|
||||
tag-str))]]))))))
|
||||
|
||||
(defn render-trace-panel []
|
||||
(let [filter-input (r/atom "")
|
||||
|
|
Loading…
Reference in New Issue