Fix indentation and style

This commit is contained in:
Dan Holmsand 2015-10-22 13:44:14 +02:00
parent 63515236cb
commit 2f6f2a4491
1 changed files with 40 additions and 39 deletions

View File

@ -107,7 +107,8 @@
;; <input type="??" >
;; The properites 'selectionStart' and 'selectionEnd' only exist on some inputs
;; See: https://html.spec.whatwg.org/multipage/forms.html#do-not-apply
(def these-inputs-have-selection-api #{"text" "textarea" "password" "search" "tel" "url"})
(def these-inputs-have-selection-api #{"text" "textarea" "password" "search"
"tel" "url"})
(defn ^boolean has-selection-api?
[input-type]
@ -119,11 +120,11 @@
(let [node (find-dom-node this)
node-value ($ node :value)]
(when (not= value node-value)
(if-not (and (identical? node (.-activeElement js/document))
(if-not (and (identical? node ($ js/document :activeElement))
(has-selection-api? ($ node :type))
(string? value)
(string? node-value))
; just set the value, no need to worry about a cursor
;; just set the value, no need to worry about a cursor
($! node :value value)
;; Setting "value" (below) moves the cursor position to the