Browse Source

fix: the graph doesn't show on the full page

Resolved #1391
Resolved #1532
Tienson Qin 4 years ago
parent
commit
5d652a520b
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/main/frontend/components/page.cljs

+ 5 - 1
src/main/frontend/components/page.cljs

@@ -435,8 +435,12 @@
 (defonce graph-ref (atom nil))
 (defonce show-journal? (atom false))
 (defonce dot-mode? (atom false))
-
 (rum/defcs global-graph < rum/reactive
+  (mixins/event-mixin
+   (fn [state]
+     (mixins/listen state js/window "resize"
+                    (fn [e]
+                      (reset! layout [js/window.outerWidth js/window.outerHeight])))))
   [state]
   (let [theme (state/sub :ui/theme)
         sidebar-open? (state/sub :ui/sidebar-open?)