Sha256: 03388022af30935fdeb7d8f96e6ae4fd6652ee09f0a3f15374ca109314abc1f0

Contents?: true

Size: 932 Bytes

Versions: 11

Compression:

Stored size: 932 Bytes

Contents

module Enjoy
  module Admin
    module EmbeddedGalleryImage
      def self.config(fields = {})
        jcrop_proc = Proc.new do
          jcrop_options :image_jcrop_options
        end

        if fields
          if fields.is_a?(Hash)
            fields.reverse_merge!({image: [:jcrop, jcrop_proc]})
          else
            finded = false
            fields.each { |g|
              finded = !!g[:fields][:image] unless finded
            }
            unless finded
              fields << {
                name: :image,
                fields: {
                  image: [:jcrop, jcrop_proc]
                }
              }
            end
          end
        end
        
        if block_given?
          Enjoy::Admin::EmbeddedElement.config(nil, fields) do |config|
            yield config
          end
        else
          Enjoy::Admin::EmbeddedElement.config(nil, fields)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
enjoy_cms-0.3.7.4 lib/enjoy/admin/embedded_gallery_image.rb
enjoy_cms-0.3.7.3 lib/enjoy/admin/embedded_gallery_image.rb
enjoy_cms-0.3.7.2 lib/enjoy/admin/embedded_gallery_image.rb
enjoy_cms-0.3.7.1 lib/enjoy/admin/embedded_gallery_image.rb
enjoy_cms-0.3.7 lib/enjoy/admin/embedded_gallery_image.rb
enjoy_cms-0.3.6.2 lib/enjoy/admin/embedded_gallery_image.rb
enjoy_cms-0.3.6.1 lib/enjoy/admin/embedded_gallery_image.rb
enjoy_cms-0.3.6 lib/enjoy/admin/embedded_gallery_image.rb
enjoy_cms-0.3.5 lib/enjoy/admin/embedded_gallery_image.rb
enjoy_cms-0.3.4 lib/enjoy/admin/embedded_gallery_image.rb
enjoy_cms-0.3.3 lib/enjoy/admin/embedded_gallery_image.rb