Wrap image uploading in anonymous function.

remotes/origin/stable5
Thomas Tanghus 13 years ago
parent 001a47afb0
commit 502f420678
  1. 2
      apps/contacts/js/contacts.js

@ -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

Loading…
Cancel
Save