application/js/field/image.js in spontaneous-0.2.0.beta7 vs application/js/field/image.js in spontaneous-0.2.0.beta8
- old
+ new
@@ -158,11 +158,11 @@
this.spinner().indeterminate();
if (files.length > 0) {
this.select_files(files);
var file = files[0],
- url = window.URL.createObjectURL(file)
+ url = this.createObjectURL(file)
, image = this.image;
this._edited_value = url;
image.__start_upload = true;
image.bind('load', function() {
if (this.image.__start_upload) {
@@ -175,12 +175,10 @@
} else {
// container.removeClass('landscape');
}
}.bind(this));
image.attr('src', url);
- // see http://www.htmlfivewow.com/slide25
- window.URL.revokeObjectURL(url);
}
return false;
}.bind(this);
var drag_enter = function(event) {
@@ -304,16 +302,15 @@
set_dimensions(width, height);
};
var files_selected = function(files) {
if (files.length > 0) {
- var file = files[0], url = window.URL.createObjectURL(file);
+ var file = files[0], url = this.createObjectURL(file);
img.attr('src', url).removeClass('empty');
this.select_files(files);
img.attr('src', url);
this._edited_value = url;
this.image.attr('src', url);
- window.URL.revokeObjectURL(url);
set_info(File.filename(file), file.fileSize, null, null);
}
}.bind(this);
var onchange = function() {