convertion delay grows with the text length (linearly to 400 chars)
This commit is contained in:
+4
-1
@@ -36,13 +36,16 @@
|
|||||||
[]
|
[]
|
||||||
(do
|
(do
|
||||||
(js/clearTimeout timer)
|
(js/clearTimeout timer)
|
||||||
|
(let [content (val $draft)
|
||||||
|
delay (Math/min timerDelay (* timerDelay (/ (count content) 400)))]
|
||||||
(def timer
|
(def timer
|
||||||
(js/setTimeout
|
(js/setTimeout
|
||||||
#(do
|
#(do
|
||||||
|
(.log js/console delay)
|
||||||
(show $dashed-line)
|
(show $dashed-line)
|
||||||
(show $input-elems)
|
(show $input-elems)
|
||||||
(inner $preview
|
(inner $preview
|
||||||
(.makeHtml md-converter (val $draft)))) timerDelay))))
|
(.makeHtml md-converter content))) delay)))))
|
||||||
|
|
||||||
; set focus to the draft textarea (if there is one)
|
; set focus to the draft textarea (if there is one)
|
||||||
(when $action
|
(when $action
|
||||||
|
|||||||
Reference in New Issue
Block a user