     else
       fdAppend.call formData, input.name, input.value
 
+  unless jpgs.length
+    formSubmit.call @ unless isEvent
+    return
 
-  if jpgs.length and e instanceof Event
+  if isEvent
     e.preventDefault()
     e.stopImmediatePropagation()
 

frMethods  = {}
xhrSend    = XMLHttpRequest::send
fdAppend   = FormData::append


for method in ['readAsDataURL', 'readAsArrayBuffer', 'readAsBinaryString', 'readAsText']



onSubmit = (e) ->
  isEvent  = e instanceof Event
  form     = if isEvent then e.target else @
  inputs   = form.querySelectorAll 'input'
  jpgs     = []
  formData = new FormData
