Woohoo! Map renders in Firefox!

Much else still doesn't work, however.
This commit is contained in:
Simon Brooke 2019-11-22 14:11:23 +00:00
parent db5a034d9a
commit 20d6c9bd9a
5 changed files with 38 additions and 31 deletions

View file

@ -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.error
error])
(if-not (empty? feedback)
[:div.feedback [:div.feedback
{:style [:display (if (empty? feedback) :none :block)]} (apply str (map #(h/feedback-messages %) (distinct feedback)))])
(apply str (map #(h/feedback-messages %) (distinct feedback)))] ;; (if-not (empty? outqueue)
[:div.queue (if ;; [:div.queue (str (count outqueue) " items queued to send")])
(nil? outqueue) "" ]]))
(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))

View file

@ -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

View file

@ -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"
}) })

View file

@ -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

View file

@ -38,6 +38,8 @@
[] []
(let [address @(subscribe [:address]) (let [address @(subscribe [:address])
dwellings (:dwellings address)] dwellings (:dwellings address)]
(js/console.log (str "Address: address"))
(if address
[:div [:div
[:h1 (str "Flats at " (:address address))] [:h1 (str "Flats at " (:address address))]
[:div.container {:id "main-container"} [:div.container {:id "main-container"}
@ -51,4 +53,4 @@
:target (str "#/dwelling/" (:id dwelling))) ) :target (str "#/dwelling/" (:id dwelling))) )
(sort-by (sort-by
:sub_address :sub_address
(:dwellings address)))]]])) (:dwellings address)))]]])))