How to use the dropzone.prototype function in dropzone

To help you get started, we’ve selected a few dropzone examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github relax / relax / lib / components / upload.jsx View on Github external
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);
        });
      }
    }
  }
github relax / relax / lib / components / upload.jsx View on Github external
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);
        });
      }
    }
github ubyssey / dispatch / dispatch / static / src / js / components / modals / ImageDropzone.jsx View on Github external
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 = {
github ubyssey / dispatch / dispatch / static / src / js / components / modals / ImageDropzone.jsx View on Github external
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)
github enyo / dropzone / js / index.js View on Github external
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="\&quot;preview\&quot;" src="\&quot;/images/preview.png\&quot;"></p>");
  }
};