Sha256: cfda2929e3991d9f50a4782f677780acba3c3de2c20ef895fb8a268498f0b6b8

Contents?: true

Size: 1.01 KB

Versions: 15

Compression:

Stored size: 1.01 KB

Contents

require 'rails_admin/config/actions'
require 'rails_admin/config/actions/base'
require 'rails_admin/config/fields'
require 'rails_admin/config/fields/types/file_upload'

module RailsAdmin
  module Config
    module Fields
      module Types
        class Jcrop < RailsAdmin::Config::Fields::Types::FileUpload
          RailsAdmin::Config::Fields::Types::register(self)

          register_instance_option(:partial) do
            :form_jcrop
          end

          register_instance_option(:jcrop_options) do
            {}
          end

          register_instance_option(:fit_image) do
            @fit_image ||= false
          end

          include ::RailsAdmin::Config::Fields::Types::UploaderMethods
        end
      end
    end
  end
end

RailsAdmin::Config::Fields.register_factory do |parent, properties, fields|
  if (properties.respond_to?(:name) ? properties.name : properties[:name]) == :jcrop
    fields << RailsAdmin::Config::Fields::Types::Jcrop.new(parent, :jcrop, properties)
    true
  else
    false
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
ack_rails_admin_jcrop-0.2.0.2 lib/rails_admin_jcrop/rails_admin.rb
ack_rails_admin_jcrop-0.2.0.1 lib/rails_admin_jcrop/rails_admin.rb
ack_rails_admin_jcrop-0.2.0 lib/rails_admin_jcrop/rails_admin.rb
ack_rails_admin_jcrop-0.1.0 lib/rails_admin_jcrop/rails_admin.rb
ack_rails_admin_jcrop-0.0.10 lib/rails_admin_jcrop/rails_admin.rb
ack_rails_admin_jcrop-0.0.9 lib/rails_admin_jcrop/rails_admin.rb
ack_rails_admin_jcrop-0.0.7 lib/rails_admin_jcrop/rails_admin.rb
ack_rails_admin_jcrop-0.0.6 lib/rails_admin_jcrop/rails_admin.rb
ack_rails_admin_jcrop-0.0.5 lib/rails_admin_jcrop/rails_admin.rb
ack_rails_admin_jcrop-0.0.4 lib/rails_admin_jcrop/rails_admin.rb
ack_rails_admin_jcrop-0.0.3 lib/rails_admin_jcrop/rails_admin.rb
ack_rails_admin_jcrop-0.0.2 lib/rails_admin_jcrop/rails_admin.rb
ack_rails_admin_jcrop-0.0.1 lib/rails_admin_jcrop/rails_admin.rb
rails_admin_jcrop-1.4.0 lib/rails_admin_jcrop/rails_admin.rb
rails_admin_jcrop-1.3.0 lib/rails_admin_jcrop/rails_admin.rb