Sha256: f4448f0b71d3d76ca505bc1e43b5eaedf41291da455468d91e692640b48d803b

Contents?: true

Size: 1.09 KB

Versions: 6

Compression:

Stored size: 1.09 KB

Contents

Voom::Presenters.define(:image_crop, namespace: :plugins) do
  helpers Demo::Helpers::IndentedGrid
  attach :top_nav
  attach :plugin_drawer
  plugin :image_crop

  page_title 'Image Crop'

  indented_grid do
    title 'Drag and drop with cropper preview'
    grid do
      column 6 do
        image_crop id: :event_image,
                   aspect_ratio: 1.0,
                   image: 'https://cdn.mos.cms.futurecdn.net/4f6d31c116fdada59a5cb16d136e3068-970-80.jpg' do
        end
      end
      column 6 do
        file_input name: :event_file_name, preview: :event_image, accept: 'image/png, image/jpeg, image/gif, image/svg+xml' do
          grid do
            column 12 do
              card do
                text 'Drop it here'
                button icon: :cloud_upload
              end
            end
          end
        end
      end
      event :change do
        replaces :context_list, ':context_list'
      end
    end
  end

  # image_crop do
  #   event :change do
  #     replaces :context_list, ':context_list'
  #   end
  # end
  attach 'context_list'
  attach :code, file: __FILE__
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
voom-presenters-2.1.2 app/demo/plugins/image_crop.pom
voom-presenters-2.1.0 app/demo/plugins/image_crop.pom
voom-presenters-2.0.3 app/demo/plugins/image_crop.pom
voom-presenters-2.0.2 app/demo/plugins/image_crop.pom
voom-presenters-2.0.1 app/demo/plugins/image_crop.pom
voom-presenters-2.0.0 app/demo/plugins/image_crop.pom