Sha256: 0f1e6b294986c53da4233994fdfc6c63ad10c8ad52d1d92628bcd649b87dd9ad

Contents?: true

Size: 922 Bytes

Versions: 9

Compression:

Stored size: 922 Bytes

Contents

(function() {
  var setup;

  scrivito.editors._file_dropzone = function(fields, callback) {
    return fields.each(function() {
      return setup($(this), callback);
    });
  };

  setup = function(el, callback) {
    el.on('dragenter', function() {
      el.children().not('img').css({
        pointerEvents: 'none'
      });
      return el.addClass('image-editor-dragover') && false;
    });
    el.on('dragleave', function() {
      el.children().not('img').css({
        pointerEvents: 'auto'
      });
      return el.removeClass('image-editor-dragover') && false;
    });
    return el.on('drop', function(e) {
      var files, ref, ref1;
      el.removeClass('image-editor-dragover');
      if (((ref = (files = (ref1 = e.originalEvent.dataTransfer) != null ? ref1.files : void 0)) != null ? ref.length : void 0) === 1) {
        callback(el, files[0]);
      }
      return false;
    });
  };

}).call(this);

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
scrivito_editors-1.0.0 app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js
scrivito_editors-1.0.0.rc4 app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js
scrivito_editors-1.0.0.rc3 app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js
scrivito_editors-1.0.0.rc2 app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js
scrivito_editors-1.0.0.rc1 app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js
scrivito_editors-0.90.0 app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js
scrivito_editors-0.90.0.rc3 app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js
scrivito_editors-0.90.0.rc2 app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js
scrivito_editors-0.90.0.rc1 app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js