Woohoo! Map renders in Firefox!
Much else still doesn't work, however.
This commit is contained in:
parent
db5a034d9a
commit
20d6c9bd9a
|
@ -119,23 +119,25 @@
|
||||||
[:div
|
[:div
|
||||||
[:header
|
[:header
|
||||||
[ui/navbar]]
|
[ui/navbar]]
|
||||||
(if content [error-boundary [content]]
|
(if content [content]
|
||||||
[:div.error (str "No content in page " @(rf/subscribe [:page]))])
|
[:div.error (str "No content in page " @(rf/subscribe [:page]))])
|
||||||
[:footer
|
[:footer
|
||||||
[:div.error {:style [:display (if (empty? error) :none :block)]} (apply str error)]
|
(if-not (empty? error)
|
||||||
[:div.feedback
|
[:div.error
|
||||||
{:style [:display (if (empty? feedback) :none :block)]}
|
error])
|
||||||
(apply str (map #(h/feedback-messages %) (distinct feedback)))]
|
(if-not (empty? feedback)
|
||||||
[:div.queue (if
|
[:div.feedback
|
||||||
(nil? outqueue) ""
|
(apply str (map #(h/feedback-messages %) (distinct feedback)))])
|
||||||
(str (count outqueue) " items queued to send"))]]]))
|
;; (if-not (empty? outqueue)
|
||||||
|
;; [:div.queue (str (count outqueue) " items queued to send")])
|
||||||
|
]]))
|
||||||
|
|
||||||
;; -------------------------
|
;; -------------------------
|
||||||
;; Routes
|
;; Routes
|
||||||
(secretary/set-config! :prefix "#")
|
(secretary/set-config! :prefix "#")
|
||||||
|
|
||||||
(secretary/defroute "/" []
|
(secretary/defroute "/" []
|
||||||
(ui/log-and-dispatch [:set-active-page :map]))
|
(ui/log-and-dispatch [:set-active-page :about]))
|
||||||
|
|
||||||
(secretary/defroute "/about" []
|
(secretary/defroute "/about" []
|
||||||
(ui/log-and-dispatch [:set-active-page :about]))
|
(ui/log-and-dispatch [:set-active-page :about]))
|
||||||
|
@ -214,7 +216,7 @@
|
||||||
(rf/dispatch [:fetch-options])
|
(rf/dispatch [:fetch-options])
|
||||||
(rf/dispatch [:fetch-issues])
|
(rf/dispatch [:fetch-issues])
|
||||||
(rf/dispatch [:fetch-followupmethods])
|
(rf/dispatch [:fetch-followupmethods])
|
||||||
(rf/dispatch [:dispatch-later [{:ms 60000 :dispatch [:process-queue]}]])
|
;; (rf/dispatch [:dispatch-later [{:ms 60000 :dispatch [:process-queue]}]])
|
||||||
(load-interceptors!)
|
(load-interceptors!)
|
||||||
(hook-browser-navigation!)
|
(hook-browser-navigation!)
|
||||||
(mount-components))
|
(mount-components))
|
||||||
|
|
|
@ -94,12 +94,14 @@
|
||||||
so back links work."
|
so back links work."
|
||||||
[id]
|
[id]
|
||||||
(js/console.log (str "Click handler for address #" id))
|
(js/console.log (str "Click handler for address #" id))
|
||||||
(let [view @(subscribe [:view])
|
;; (let [view @(subscribe [:view])
|
||||||
centre (.getCenter view)]
|
;; centre (.getCenter view)]
|
||||||
(dispatch [:set-zoom (.getZoom view)])
|
;; (dispatch [:set-zoom (.getZoom view)])
|
||||||
(dispatch [:set-latitude (.-lat centre)])
|
;; (dispatch [:set-latitude (.-lat centre)])
|
||||||
(dispatch [:set-longitude (.-lng centre)]))
|
;; (dispatch [:set-longitude (.-lng centre)]))
|
||||||
(set! window.location.href (str "#building/" id)))
|
(js/console.log (str "Navigating to " "#building/" id))
|
||||||
|
(set! window.location.href (str "#building/" id))
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
(defn add-map-pin
|
(defn add-map-pin
|
||||||
|
|
|
@ -77,6 +77,7 @@
|
||||||
{:fetch-locality "Fetching local data."
|
{:fetch-locality "Fetching local data."
|
||||||
:send-request "Request has been queued."
|
:send-request "Request has been queued."
|
||||||
:send-intention-and-visit "Voting intention has been sent"
|
:send-intention-and-visit "Voting intention has been sent"
|
||||||
|
:bad-address "No valid address has been selected"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
(reg-sub
|
(reg-sub
|
||||||
:error
|
:error
|
||||||
(fn [db _]
|
(fn [db _]
|
||||||
(:error db)))
|
(apply str (:error db))))
|
||||||
|
|
||||||
(reg-sub
|
(reg-sub
|
||||||
:feedback
|
:feedback
|
||||||
|
|
|
@ -38,17 +38,19 @@
|
||||||
[]
|
[]
|
||||||
(let [address @(subscribe [:address])
|
(let [address @(subscribe [:address])
|
||||||
dwellings (:dwellings address)]
|
dwellings (:dwellings address)]
|
||||||
[:div
|
(js/console.log (str "Address: address"))
|
||||||
[:h1 (str "Flats at " (:address address))]
|
(if address
|
||||||
[:div.container {:id "main-container"}
|
[:div
|
||||||
(ui/back-link "#map")
|
[:h1 (str "Flats at " (:address address))]
|
||||||
[:div {:id "dwelling-list"}
|
[:div.container {:id "main-container"}
|
||||||
(map
|
(ui/back-link "#map")
|
||||||
(fn
|
[:div {:id "dwelling-list"}
|
||||||
[dwelling]
|
(map
|
||||||
(ui/big-link
|
(fn
|
||||||
(:sub_address dwelling)
|
[dwelling]
|
||||||
:target (str "#/dwelling/" (:id dwelling))) )
|
(ui/big-link
|
||||||
(sort-by
|
(:sub_address dwelling)
|
||||||
:sub_address
|
:target (str "#/dwelling/" (:id dwelling))) )
|
||||||
(:dwellings address)))]]]))
|
(sort-by
|
||||||
|
:sub_address
|
||||||
|
(:dwellings address)))]]])))
|
||||||
|
|
Loading…
Reference in a new issue