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.news.anyargs :as anyargs]
[reagentdemo.news.async :as async]
[reagentdemo.news.undo-demo :as undo-demo]))
[reagentdemo.news.undodemo :as undodemo]))
(defn main []
[:div
[anyargs/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]]
[reagent.debug :refer-macros [dbg println]]
[reagentdemo.syntax :refer-macros [get-source]]
@ -6,7 +6,7 @@
[reagentdemo.common :as common :refer [demo-component]]
[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 state todomvc/todos)

View File

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