application/js/field/file.js in spontaneous-0.2.0.beta4 vs application/js/field/file.js in spontaneous-0.2.0.beta5
- old
+ new
@@ -270,10 +270,27 @@
// do nothing
} else {
this.selected_files = null;
this.set('value', value);
}
+ },
+ stringValue: function() {
+ if (this.mark_cleared) {
+ this.mark_cleared = false;
+ return { name: this.form_name(), value: '' };
+ }
+ return false; // don't upload this field as text
+ },
+
+ mark_cleared: false,
+
+ clear_file: function() {
+ // this.set('value', {});
+ this.mark_cleared = true;
+ this.selected_files = null;
+ this.mark_modified();
}
+
});
return FileField;
})(jQuery, Spontaneous);