From ce36b0bf71610bef763702f4248fae49a7fde58f Mon Sep 17 00:00:00 2001 From: Daniel Turczanski Date: Thu, 4 Apr 2013 00:07:37 +0100 Subject: [PATCH] App is getting embedded in div with id 'content' instead of body. This allows interactive programming using cljs REPL --- src/webfui/core.cljs | 3 +-- src/webfui/dom_manipulation.cljs | 2 +- src/webfui/utilities.cljs | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) 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]))