Wrap image uploading in anonymous function.

This commit is contained in:
Thomas Tanghus 2012-07-15 20:45:54 +02:00
parent 001a47afb0
commit 502f420678
1 changed files with 45 additions and 43 deletions

View File

@ -1643,6 +1643,7 @@ $(document).ready(function(){
Contacts.UI.Card.saveProperty(this);
});
$(function() {
// Upload function for dropped contact photos files. Should go in the Contacts class/object.
$.fileUpload = function(files){
var file = files[0];
@ -1690,6 +1691,7 @@ $(document).ready(function(){
xhr.setRequestHeader('Content-Type', file.type);
xhr.send(file);
}
});
$(document).bind('drop dragover', function (e) {
e.preventDefault(); // prevent browser from doing anything, if file isn't dropped in dropZone