Avoid some warnings in demo

This commit is contained in:
Dan Holmsand 2014-02-22 08:21:21 +01:00
parent 908452c126
commit 0457b2535e
3 changed files with 7 additions and 7 deletions

View File

@ -5,10 +5,10 @@
[reagentdemo.common :as common :refer [demo-component]] [reagentdemo.common :as common :refer [demo-component]]
[reagentdemo.news.anyargs :as anyargs] [reagentdemo.news.anyargs :as anyargs]
[reagentdemo.news.async :as async] [reagentdemo.news.async :as async]
[reagentdemo.news.undo-demo :as undo-demo])) [reagentdemo.news.undodemo :as undodemo]))
(defn main [] (defn main []
[:div [:div
[anyargs/main {:summary true}] [anyargs/main {:summary true}]
[async/main {:summary true}] [async/main {:summary true}]
[undo-demo/main {:summary true}]]) [undodemo/main {:summary true}]])

View File

@ -1,4 +1,4 @@
(ns reagentdemo.news.undo-demo (ns reagentdemo.news.undodemo
(:require [reagent.core :as reagent :refer [atom]] (:require [reagent.core :as reagent :refer [atom]]
[reagent.debug :refer-macros [dbg println]] [reagent.debug :refer-macros [dbg println]]
[reagentdemo.syntax :refer-macros [get-source]] [reagentdemo.syntax :refer-macros [get-source]]
@ -6,7 +6,7 @@
[reagentdemo.common :as common :refer [demo-component]] [reagentdemo.common :as common :refer [demo-component]]
[todomvc :as todomvc])) [todomvc :as todomvc]))
(def funmap (-> "reagentdemo/news/undo-demo.cljs" get-source common/fun-map)) (def funmap (-> ::this get-source common/fun-map))
(def src-for (partial common/src-for funmap)) (def src-for (partial common/src-for funmap))
(def state todomvc/todos) (def state todomvc/todos)

View File

@ -77,7 +77,8 @@
(.preventDefault e) (.preventDefault e)
(reset! page href) (reset! page href)
(reagent/next-tick (reagent/next-tick
#(set! (.-scrollTop (.-body js/document)) 0))) #(set! (.-scrollTop (.-documentElement js/document))
0)))
identity)) identity))
child])) child]))
@ -89,7 +90,6 @@
(defn title [name] (defn title [name]
(when (= @title-atom "") (when (= @title-atom "")
(if reagent/is-client (if reagent/is-client
(let [title (aget (.getElementsByTagName js/document "title") 0)] (set! (.-title js/document) name))
(set! (.-innerHTML title) name)))
(reset! title-atom name)) (reset! title-atom name))
[:div]) [:div])