app/assets/javascripts/faalis/dashboard/modules/fields/#image.js# in faalis-1.0.0.alpha3 vs app/assets/javascripts/faalis/dashboard/modules/fields/#image.js# in faalis-1.0.0.alpha4
- old
+ new
@@ -10,19 +10,19 @@
scope.element_id = "id_" + scope.field;
scope.msg_element_id = "id_" + scope.field + "_msg";
function updateModel(event){
if(event.target && event.target.files){
- var file = event.target.files[0];j
+ var file = event.target.files[0];
var reader = new FileReader();
reader.onload = function(e){
var image = e.target.result;
console.log("IMAGE DATA: %s", image);
ngctrl.$setViewValue({filename: file.name,
- data: image,
+ image_data: image,
content_type: file.type});
ngctrl.$render();
-
+
};
reader.readAsDataURL(file);
}
}