mirror of
https://github.com/penpot/penpot.git
synced 2025-04-05 19:41:27 -05:00
Add more dom creation and manipulation functions to util.dom ns.
This commit is contained in:
parent
71c6adab58
commit
168c5b490c
1 changed files with 30 additions and 0 deletions
|
@ -82,3 +82,33 @@
|
|||
"Extract the files from event instance."
|
||||
[event]
|
||||
(get-files (get-target event)))
|
||||
|
||||
(defn create-element
|
||||
([tag]
|
||||
(.createElement js/document tag))
|
||||
([ns tag]
|
||||
(.createElementNS js/document ns tag)))
|
||||
|
||||
(defn set-html!
|
||||
[el html]
|
||||
(set! (.-innerHTML el) html))
|
||||
|
||||
(defn append-child!
|
||||
[el child]
|
||||
(.appendChild el child))
|
||||
|
||||
(defn get-first-child
|
||||
[el]
|
||||
(.-firstChild el))
|
||||
|
||||
(defn get-tag-name
|
||||
[el]
|
||||
(.-tagName el))
|
||||
|
||||
(defn get-outer-html
|
||||
[el]
|
||||
(.-outerHTML el))
|
||||
|
||||
(defn query
|
||||
[el query]
|
||||
(.querySelector el query))
|
||||
|
|
Loading…
Add table
Reference in a new issue