Merge pull request #13 from scambra/safari-fixes

fix js success callback on safari when uploading files
This commit is contained in:
icewind1991 2012-09-20 02:24:27 -07:00
commit 4ea128ee43
1 changed files with 2 additions and 1 deletions

View File

@ -361,7 +361,8 @@ $(document).ready(function() {
}
}else{
data.submit().success(function(data, status) {
response = jQuery.parseJSON(data[0].body.innerText);
// in safari data is a string
response = jQuery.parseJSON(typeof data === 'string' ? data : data[0].body.innerText);
if(response[0] != undefined && response[0].status == 'success') {
var file=response[0];
delete uploadingFiles[file.name];