diff --git a/frontend/src/uxbox/main/exports.cljs b/frontend/src/uxbox/main/exports.cljs index 9557e5100..7b3bdecdb 100644 --- a/frontend/src/uxbox/main/exports.cljs +++ b/frontend/src/uxbox/main/exports.cljs @@ -14,6 +14,7 @@ [uxbox.main.ui.shapes.path :refer [path-shape]] [uxbox.main.ui.shapes.circle :refer [circle-shape]] [uxbox.main.ui.shapes.image :refer [image-shape]] + [uxbox.util.dom :as dom] [rumext.core :as mx :include-macros true])) (def ^:dynamic *state* st/state) @@ -67,6 +68,6 @@ (try (let [page (get-in @*state* [:pages id])] (when (:shapes page) - (mx/render-static-html (page-svg page)))) + (dom/render-to-html (page-svg page)))) (catch :default e nil))) diff --git a/frontend/src/uxbox/main/ui/shapes/text.cljs b/frontend/src/uxbox/main/ui/shapes/text.cljs index ece5b48c8..eb28bbe40 100644 --- a/frontend/src/uxbox/main/ui/shapes/text.cljs +++ b/frontend/src/uxbox/main/ui/shapes/text.cljs @@ -142,7 +142,7 @@ [own] (let [[shape] (:rum/args own) dom (mx/ref-node own "fobject") - html (mx/render-static-html (text-shape-html shape))] + html (dom/render-to-html (text-shape-html shape))] (set! (.-innerHTML dom) html)) own) @@ -152,7 +152,7 @@ [shape] (:rum/args own)] (when (not= shape old-shape) (let [dom (mx/ref-node own "fobject") - html (mx/render-static-html (text-shape-html shape))] + html (dom/render-to-html (text-shape-html shape))] (set! (.-innerHTML dom) html))) own)) diff --git a/frontend/src/uxbox/util/dom.cljs b/frontend/src/uxbox/util/dom.cljs index ebf5f42e9..c4540a1ec 100644 --- a/frontend/src/uxbox/util/dom.cljs +++ b/frontend/src/uxbox/util/dom.cljs @@ -6,7 +6,8 @@ ;; Copyright (c) 2015-2016 Juan de la Cruz (ns uxbox.util.dom - (:require [goog.dom :as dom])) + (:require [goog.dom :as dom] + [cljsjs.react.dom.server])) ;; --- Deprecated methods @@ -24,6 +25,10 @@ ;; --- New methods +(defn render-to-html + [component] + (.renderToStatciMarkup js/ReactDOMServer component)) + (defn get-element-by-class ([classname] (dom/getElementByClass classname))