Sha256: ba50cf680d7e611e1860dcb9f50438ca9386e429b71477a314b6444ab3cf0fc9

Contents?: true

Size: 673 Bytes

Versions: 21

Compression:

Stored size: 673 Bytes

Contents

class ColorPickerInput < ActiveAdminAddons::InputBase
  DEFAULT_PALETTE = [
    "#000000",
    "#333333",
    "#663300",
    "#CC0000",
    "#CC3300",
    "#FFCC00",
    "#009900",
    "#006666",
    "#0066FF",
    "#0000CC",
    "#663399",
    "#CC0099",
    "#FF9999",
    "#FF9966",
    "#FFFF99",
    "#99FF99",
    "#66FFCC",
    "#99FFFF",
    "#66CCFF",
    "#9999FF",
    "#FF99FF",
    "#FFCCCC",
    "#FFCC99",
    "#FFFFFF"
  ]

  def render_custom_input
    concat(label_html)
    concat(builder.hidden_field(method, input_html_options))
  end

  def load_control_attributes
    load_data_attr(:palette, default: DEFAULT_PALETTE, formatter: :to_json)
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
activeadmin_addons-2.0.0.beta.3 app/inputs/color_picker_input.rb
activeadmin_addons-1.10.1 app/inputs/color_picker_input.rb
activeadmin_addons-2.0.0.beta.2 app/inputs/color_picker_input.rb
activeadmin_addons-2.0.0.beta.0 app/inputs/color_picker_input.rb
activeadmin_addons-1.10.0 app/inputs/color_picker_input.rb
activeadmin_addons-1.9.0 app/inputs/color_picker_input.rb
activeadmin_addons-1.8.3 app/inputs/color_picker_input.rb
activeadmin_addons-1.8.2 app/inputs/color_picker_input.rb
activeadmin_addons_rails6-1.7.2 app/inputs/color_picker_input.rb
activeadmin_addons-1.7.1 app/inputs/color_picker_input.rb
activeadmin_addons-1.7.0 app/inputs/color_picker_input.rb
activeadmin_addons-1.6.0 app/inputs/color_picker_input.rb
activeadmin_addons-1.5.0 app/inputs/color_picker_input.rb
activeadmin_addons-1.4.0 app/inputs/color_picker_input.rb
activeadmin_addons-1.3.0 app/inputs/color_picker_input.rb
activeadmin_addons-1.2.0 app/inputs/color_picker_input.rb
activeadmin_addons-1.1.2 app/inputs/color_picker_input.rb
activeadmin_addons-1.1.1 app/inputs/color_picker_input.rb
activeadmin_addons-1.1.0 app/inputs/color_picker_input.rb
activeadmin_addons-1.0.1 app/inputs/color_picker_input.rb