Skip to content

Commit

Permalink
fix:custom event cljs->js conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
KBHan committed Dec 3, 2017
1 parent dd78e9e commit 3b0fa4d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/klipse/klipse_editors.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
(let [evaluation-chan (eval-fn (str preamble src-code) @state)
first-result (<! evaluation-chan)]
(let [custom-event (js/CustomEvent. "klipse-snippet-evaled"
#js {:detail {:state (clj->js @state)
:src-code src-code}})]
(clj->js {:detail {:state (clj->js @state)
:src-code src-code}}))]
(when-let [code-mirror-dom-node (js/document.querySelector ".klipse-container")]
(-> code-mirror-dom-node (.dispatchEvent custom-event))))
(setter first-result)
Expand Down Expand Up @@ -108,7 +108,7 @@
(s/def ::codemirror-options map?)
(s/def ::editor-mode string?)

(s/fdef editor-options
(s/fdef editor-options
:args (s/cat :in-mode ::editor-mode
:out-mode ::editor-mode
:options-in ::codemirror-options
Expand All @@ -133,7 +133,7 @@
in-editor (replace-element-by-editor element source-code in-editor-options :indent? indent?)
snippet-args {:loop-msec loop-msec
:preamble preamble}

state (create-state :container container :result-element result-element :editor-args editor-args)]
(when result-element (gdom/setTextContent result-element default-txt))
(handle-events in-editor
Expand Down

0 comments on commit 3b0fa4d

Please sign in to comment.