PluginProbe
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce / 3.1.2
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce v3.1.2
3.3.0 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.1 trunk 1.0.4 1.1.0 1.1.0.1 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 All 162 releases
cartflows / modules / gutenberg / assets / js / editor-assets.js

editor-assets.js in CartFlows – Funnel Builder & Checkout Plugin for WooCommerce 3.1.2, at modules/gutenberg/assets/js/editor-assets.js

50 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 ( function ( $ ) {
2 /**
3 * Function to add the custom Class to the color picker to add a separator.
4 * This is used to add the add a heading to display the CartFlows Colors.
5 */
6 const add_color_pallet_separator = function () {
7 $( document ).on(
8 'click',
9 '.block-editor-panel-color-gradient-settings__dropdown, .component-color-indicator',
10 function () {
11 $( '.components-circular-option-picker__option' ).each(
12 function () {
13 const color_separator = $( this );
14 let color_separator_wrapper = '';
15
16 if (
17 color_separator.attr( 'aria-label' ) ===
18 'Color: CartFlows Separator'
19 ) {
20 color_separator_wrapper = color_separator.closest(
21 '.components-circular-option-picker__option-wrapper'
22 );
23
24 if (
25 ! color_separator_wrapper.hasClass(
26 'wcf-color-pallet-separator'
27 )
28 ) {
29 color_separator_wrapper.addClass(
30 'wcf-color-pallet-separator'
31 );
32 color_separator.addClass(
33 'wcf-color-pallet-separator--button'
34 );
35 color_separator.append(
36 '<span class="wcf-color-pallet-separator--heading">CartFlows Global Colors</span>'
37 );
38 }
39 }
40 }
41 );
42 }
43 );
44 };
45
46 $( function () {
47 add_color_pallet_separator();
48 } );
49 } )( jQuery );
50