Sha256: 099e2755e2ea4d5ed0ca8d98dfa81154efaad53b2d37d9b7b5c0654767d98255

Contents?: true

Size: 554 Bytes

Versions: 11

Compression:

Stored size: 554 Bytes

Contents

scrivito.editors._file_dropzone = (fields, callback) -> fields.each(-> setup $(this), callback)

setup = (el, callback) ->
  el.on 'dragenter', ->
    el.children().not('img').css(pointerEvents: 'none')
    el.addClass('image-editor-dragover') and off

  el.on 'dragleave', ->
    el.children().not('img').css(pointerEvents: 'auto')
    el.removeClass('image-editor-dragover') and off

  el.on 'drop', (e) ->
    el.removeClass 'image-editor-dragover'
    if (files = e.originalEvent.dataTransfer?.files)?.length is 1
      callback el, files[0]
    off

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
scrivito_editors-0.70.2 app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js.coffee
scrivito_editors-0.71.2 app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js.coffee
scrivito_editors-0.71.1 app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js.coffee
scrivito_editors-0.70.1 app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js.coffee
scrivito_editors-0.71.0 app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js.coffee
scrivito_editors-0.71.0.rc2 app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js.coffee
scrivito_editors-0.71.0.rc1 app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js.coffee
scrivito_editors-0.70.0 app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js.coffee
scrivito_editors-0.70.0.rc3 app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js.coffee
scrivito_editors-0.70.0.rc2 app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js.coffee
scrivito_editors-0.70.0.rc1 app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js.coffee