mirror of https://github.com/status-im/reagent.git
content to set-content
This commit is contained in:
parent
b54b1b0957
commit
c95a9ec7ba
|
@ -31,9 +31,9 @@
|
|||
(def title "Minimalistic React for ClojureScript")
|
||||
|
||||
(defroute "/" []
|
||||
(dispatch [:content [#'intro/main] title]))
|
||||
(dispatch [:set-content [#'intro/main] title]))
|
||||
(defroute main-page "/index.html" []
|
||||
(dispatch [:content [#'intro/main] title]))
|
||||
(dispatch [:set-content [#'intro/main] title]))
|
||||
(tools/reg-page (main-page))
|
||||
|
||||
|
||||
|
|
|
@ -16,5 +16,5 @@
|
|||
[undodemo/main {:summary true}]])
|
||||
|
||||
(defroute path "/news/index.html" []
|
||||
(dispatch [:content [#'main] "News"]))
|
||||
(dispatch [:set-content [#'main] "News"]))
|
||||
(tools/reg-page (path))
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
(declare main)
|
||||
(defroute path "/news/any-arguments.html" []
|
||||
(dispatch [:content [#'main] title]))
|
||||
(dispatch [:set-content [#'main] title]))
|
||||
(tools/reg-page (path))
|
||||
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
(declare main)
|
||||
(defroute path "/news/reagent-is-async.html" []
|
||||
(dispatch [:content [#'main] title]))
|
||||
(dispatch [:set-content [#'main] title]))
|
||||
(tools/reg-page (path))
|
||||
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
(declare main)
|
||||
(defroute path "/news/binary-clock.html" []
|
||||
(dispatch [:content [#'main] title]))
|
||||
(dispatch [:set-content [#'main] title]))
|
||||
(tools/reg-page (path))
|
||||
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
(declare main)
|
||||
(defroute path "/news/news050.html" []
|
||||
(dispatch [:content [#'main] title]))
|
||||
(dispatch [:set-content [#'main] title]))
|
||||
(tools/reg-page (path))
|
||||
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
(declare main)
|
||||
(defroute path "/news/cloact-reagent-undo-demo.html" []
|
||||
(dispatch [:content [#'main] title]))
|
||||
(dispatch [:set-content [#'main] title]))
|
||||
(tools/reg-page (path))
|
||||
|
||||
|
||||
|
|
|
@ -47,15 +47,12 @@
|
|||
|
||||
(defn demo-handler [state [id v1 v2 :as event]]
|
||||
(case id
|
||||
:content (do
|
||||
(let [title (if v2
|
||||
(str (:title-prefix state) v2)
|
||||
(str (:default-title state)))]
|
||||
(when r/is-client
|
||||
(r/next-tick #(set! js/document.title title)))
|
||||
(assoc state
|
||||
:main-content v1
|
||||
:title title)))
|
||||
:set-content (let [title (if v2
|
||||
(str (:title-prefix state) v2)
|
||||
(str (:default-title state)))]
|
||||
(when r/is-client
|
||||
(r/next-tick #(set! js/document.title title)))
|
||||
(assoc state :main-content v1 :title title))
|
||||
:set-page (do (secretary/dispatch! v1)
|
||||
(assoc state :page-name v1))
|
||||
:goto-page (do
|
||||
|
|
Loading…
Reference in New Issue