colorpicker callback modification
-
Is there any way to modify the colorpicker iris callback options?
I’m looking to add a callback on change for the colorpicker in repeatable group fields.
For example:
$group_field_id = $cmb2->add_field(array( 'id' => $prefix . '_color_group', 'type' => 'group', 'description' => __('Generates reusable form entries', 'cmb2'), 'options' => array( 'group_title' => __('Color {#}', 'cmb2'), 'add_button' => __('Add Another Color', 'cmb2'), 'remove_button' => __('Remove Color', 'cmb2'), 'sortable' => true, ), )); $cmb2->add_group_field($group_field_id, array( 'name' => 'Border/Line Color', 'id' => $prefix . '_color', 'type' => 'colorpicker', 'classes' => 'chart-border-line-color half-col-option', )); $cmb2->add_group_field($group_field_id, array( 'name' => 'Background/Fill Color', 'id' => $prefix . '_fill_color', 'classes' => 'chart-bg-fill-color half-col-option', 'type' => 'colorpicker', ));
I want to do something as below but it doesn’t behave properly. The chosen color doesn’t always show up in the preview box with this method:
$('input.wp-color-picker').iris({ change: function(event, ui){ update_graph_colors(); }, });
Any input on this? In the docs I only see options to modify the colorpicker options but not for callbacks for the colorpicker.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘colorpicker callback modification’ is closed to new replies.