Sha256: 53c57fc6c7b009d93908dfe9aa7cb7d6e0730d8d4dd4df8bd52004895e322805

Contents?: true

Size: 361 Bytes

Versions: 6

Compression:

Stored size: 361 Bytes

Contents

import moment from 'moment'

export function encodeImageFileAsURL(element) {
  return new Promise((resolve, reject) => {
    var file = element.files[0];
    var reader = new FileReader();
    reader.fileName = file.name
    reader.onloadend = function() {
      resolve({src: reader.result, name: reader.fileName})
    }
    reader.readAsDataURL(file);
  })
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails_admin_image_manager-0.1.34 app/assets/javascripts/rails_admin_image_manager/libs/helpers.js
rails_admin_image_manager-0.1.33 app/assets/javascripts/rails_admin_image_manager/libs/helpers.js
rails_admin_image_manager-0.1.31 app/assets/javascripts/rails_admin_image_manager/libs/helpers.js
rails_admin_image_manager-0.1.30 app/assets/javascripts/rails_admin_image_manager/libs/helpers.js
rails_admin_image_manager-0.1.3 app/assets/javascripts/rails_admin_image_manager/libs/helpers.js
rails_admin_image_manager-0.1.29 app/assets/javascripts/rails_admin_image_manager/libs/helpers.js