lib/assets/javascripts/bindings.js.coffee in kolo-0.7.2 vs lib/assets/javascripts/bindings.js.coffee in kolo-0.7.3

- old
+ new

@@ -172,13 +172,19 @@ uploadFile = (file)=> viewModel[onStartUpload]() if viewModel[onStartUpload]? formData = new FormData formData.append parameter, file xhr = new XMLHttpRequest - xhr.addEventListener 'load', (event)-> - viewModel[onComplete]() if viewModel[onComplete]? + if xhr.addEventListener? + xhr.addEventListener 'load', (event)-> + viewModel[onComplete]() if viewModel[onComplete]? + else + xhr.attachEvent 'load', (event)-> + viewModel[onComplete]() if viewModel[onComplete]? xhr.open 'POST', url xhr.send formData + + element.addEventListener = element.attachEvent unless element.addEventListener? element.addEventListener 'drop', (event)=> event.stopPropagation() event.preventDefault() files = event.dataTransfer.files