Use html5 accept attribute for filter image types on upload forms.

This commit is contained in:
Andrey Antukh 2016-10-26 00:39:39 +02:00
parent cc53ba68b5
commit f9366c3146
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95
3 changed files with 3 additions and 0 deletions

View file

@ -205,6 +205,7 @@
:multiple true :multiple true
:ref "file-input" :ref "file-input"
:value "" :value ""
:accept "image/svg+xml"
:type "file" :type "file"
:on-change on-file-selected}]])) :on-change on-file-selected}]]))

View file

@ -206,6 +206,7 @@
:multiple true :multiple true
:ref "file-input" :ref "file-input"
:value "" :value ""
:accept "image/jpeg,image/png"
:type "file" :type "file"
:on-change on-file-selected}]]))) :on-change on-file-selected}]])))

View file

@ -81,6 +81,7 @@
[:span.text "Upload file"] [:span.text "Upload file"]
[:input.upload-image-input [:input.upload-image-input
{:style {:display "none"} {:style {:display "none"}
:accept "image/jpeg,image/png"
:type "file" :type "file"
:ref "input" :ref "input"
:on-change on-files-selected}]]] :on-change on-files-selected}]]]