Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount () {
if (typeof document !== 'undefined' && this.props.action) {
var options = {};
for (var opt in Dropzone.prototype.defaultOptions) {
var prop = this.props[opt];
if (prop) {
options[opt] = prop;
continue;
}
options[opt] = Dropzone.prototype.defaultOptions[opt];
}
this.dropzone = new Dropzone(findDOMNode(this), options);
if (this.props.query) {
this.dropzone.on('sending', (file, xhr, formData) => {
formData.append('query', this.props.query);
});
}
}
}
componentDidMount () {
if (typeof document !== 'undefined' && this.props.action) {
var options = {};
for (var opt in Dropzone.prototype.defaultOptions) {
var prop = this.props[opt];
if (prop) {
options[opt] = prop;
continue;
}
options[opt] = Dropzone.prototype.defaultOptions[opt];
}
this.dropzone = new Dropzone(findDOMNode(this), options);
if (this.props.query) {
this.dropzone.on('sending', (file, xhr, formData) => {
formData.append('query', this.props.query);
});
}
}
componentDidMount: function() {
var options = {};
for (var opt in Dropzone.prototype.defaultOptions) {
var prop = this.props[opt];
if (prop) {
options[opt] = prop;
continue;
}
options[opt] = Dropzone.prototype.defaultOptions[opt];
}
options.addedfile = function(file){};
options.success = function(file, image){
$(file.previewElement).addClass("catalog-image");
$(file.previewElement).data("id", image.id);
$(file.previewElement).data("url", image.url);
this.props.onUpload(file, image);
}.bind(this);
options.params = {
componentDidMount: function() {
var options = {};
for (var opt in Dropzone.prototype.defaultOptions) {
var prop = this.props[opt];
if (prop) {
options[opt] = prop;
continue;
}
options[opt] = Dropzone.prototype.defaultOptions[opt];
}
options.addedfile = function(file){};
options.success = function(file, image){
$(file.previewElement).addClass("catalog-image");
$(file.previewElement).data("id", image.id);
$(file.previewElement).data("url", image.url);
this.props.onUpload(file, image);
}.bind(this);
options.params = {
'csrfmiddlewaretoken': dispatch.getCSRFToken(),
}
this.dropzone = new Dropzone(this.getDOMNode(), options);
this.dropzone.on("uploadprogress", this.props.updateProgress);
this.dropzone.on("thumbnail", this.props.addFile)
fallback: function() {
Dropzone.prototype.defaultOptions.fallback.call(this);
o(this.element).append("<p>This is what the file uploads with Dropzone look like in modern browsers:<br><img alt="\"preview\"" src="\"/images/preview.png\""></p>");
}
};