add functions to create js-objs from hickory
This commit is contained in:
parent
5be6f866bc
commit
7c73735a64
1 changed files with 18 additions and 6 deletions
|
@ -67,12 +67,24 @@
|
||||||
(.-classList)
|
(.-classList)
|
||||||
(.add "was-validated")))
|
(.add "was-validated")))
|
||||||
|
|
||||||
(defn replace-element-content
|
(defn create-js-obj-from-html
|
||||||
[name
|
[html-string]
|
||||||
content]
|
(-> js/document
|
||||||
(-> (get-element-by-id name)
|
.createRange
|
||||||
(.-innerHTML)
|
(.createContextualFragment html-string)))
|
||||||
(set! (hr/hickory-to-html content))))
|
|
||||||
|
(defn append-to-body
|
||||||
|
[js-obj]
|
||||||
|
(-> js/document
|
||||||
|
.-body
|
||||||
|
(.appendChild js-obj)))
|
||||||
|
|
||||||
|
(defn append-hickory
|
||||||
|
[hickory-obj]
|
||||||
|
(-> hickory-obj
|
||||||
|
(hr/hickory-to-html)
|
||||||
|
(create-js-obj-from-html)
|
||||||
|
(append-to-body)))
|
||||||
|
|
||||||
(defn generate-feedback-tag
|
(defn generate-feedback-tag
|
||||||
[id]
|
[id]
|
||||||
|
|
Loading…
Reference in a new issue