diff --git a/src/webfui/core.cljs b/src/webfui/core.cljs index 6ea09a6..d28d7f1 100644 --- a/src/webfui/core.cljs +++ b/src/webfui/core.cljs @@ -4,9 +4,8 @@ [cljs.reader :only [read-string]])) ;; This file contains the core engine for webfui. You usually don't want to load this file directly, instead load webfui.dom or webfui.framework. - (defn body [] - (.-body js/document)) + (.getElementById js/document "content")) (defn select-path-dom [node path] (if-let [[cur & more] (seq path)] diff --git a/src/webfui/dom_manipulation.cljs b/src/webfui/dom_manipulation.cljs index 615c8d9..655d9e2 100644 --- a/src/webfui/dom_manipulation.cljs +++ b/src/webfui/dom_manipulation.cljs @@ -4,7 +4,7 @@ ;; This file is for DOM manipulation functions used by both the core of webfui as well as plugins. (defn path-dom [node] - (drop 3 + (drop 4 (reverse ((fn f [node] (lazy-seq (when node (cons (dec (count (take-while identity (iterate #(.-previousSibling %) node)))) (f (.-parentNode node)))))) diff --git a/src/webfui/utilities.cljs b/src/webfui/utilities.cljs index 76ec1cd..6bd5604 100644 --- a/src/webfui/utilities.cljs +++ b/src/webfui/utilities.cljs @@ -1,7 +1,7 @@ (ns webfui.utilities) (defn body [] - (.-body js/document)) + (.getElementById js/document "content")) (defn get-attribute [element key] (get-in element [1 key]))