Sha256: 731dc12f89982566252e7f2a898a687f6c994ceb0a5d04491384ddd44e41d207

Contents?: true

Size: 850 Bytes

Versions: 1

Compression:

Stored size: 850 Bytes

Contents

= form.send field.view_helper, field.method_name, field.html_attributes.reverse_merge({:style => "background-color: #{field.color}"})

= javascript_include_tag asset_path 'rails_admin/jquery.colorpicker.js'
= stylesheet_link_tag asset_path 'rails_admin/jquery.colorpicker.css'

= javascript_tag do
  :plain
    jQuery(function($) {
      var input = $('##{ field.dom_id }')
      input.css('backgroundColor', '#' + input.val());
      input.ColorPicker({
        color: input.val(),
        onShow: function (el) {
          $(el).fadeIn(500);
        	return false;
        },
        onHide: function (el) {
        	$(el).fadeOut(500);
          return false;
        },
        onChange: function (hsb, hex, rgb) {
          input.val(hex);
          input.css('backgroundColor', '#' + hex);
        }
      });
    });

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
elucid-rails_admin-0.0.1 app/views/rails_admin/main/_form_colorpicker.html.haml