Skip to content

Commit

Permalink
Fix bug with 'children' fn. Make logging more flexible
Browse files Browse the repository at this point in the history
  • Loading branch information
levand committed Jul 6, 2012
1 parent 2d48c56 commit 5f9f915
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/cljs/domina.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@
;;;;;;;;;;;;;;;;;;; Public API ;;;;;;;;;;;;;;;;;

(def *debug* true)
(defn log-debug [mesg]
(defn log-debug [& mesg]
(when (and *debug* (not (= (.-console js/window) js/undefined)))
(.log js/console mesg)))
(.log js/console (apply str mesg))))

(defn log [mesg]
(defn log [& mesg]
(when (.-console js/window)
(.log js/console mesg)))
(.log js/console (apply str mesg))))

(defn by-id
"Returns content containing a single node by looking up the given ID"
Expand All @@ -126,7 +126,7 @@
(defn children
"Gets all the child nodes of the elements in a content. Same as (xpath content '*') but more efficient."
[content]
(mapcat dom/getChildren (nodes content)))
(doall (mapcat dom/getChildren (nodes content))))

(defn clone
"Returns a deep clone of content."
Expand Down
2 changes: 1 addition & 1 deletion test/cljs/domina/test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
set-styles! set-attrs! has-class? add-class!
remove-class! classes set-classes! text
set-text! value set-value! html set-html!
set-data! get-data log-debug]]
set-data! get-data log-debug log]]
[domina.xpath :only [xpath]]
[domina.css :only [sel]]
[domina.events :only [listen! capture! listen-once! capture-once!
Expand Down

0 comments on commit 5f9f915

Please sign in to comment.