Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter miturn

    (@miturn)

    Andrew appreciate the help. If I’m customizing something on the page that is not a tailor element – like nav or header can I refresh the preview frame. Like in the wordpress customizer.

    wp.customize.previewer.refresh(); or a selective refresh?

    Thread Starter miturn

    (@miturn)

    I tried the refresh after I couldn’t get it to work.

    $panel_manager->add_control( 'theme_menu_text_color', array(
    		        'label'                 =>  __( 'Navigation Font Color', 'theme' ),
    		        'description'           =>  __( '', 'theme' ),
    		        'type'                  =>  'color',
    		        'priority'              =>  15,
    		        'section'               =>  'general',
    		        'setting'               =>  'theme_menu_color',
    		    ) );

    It seems that the wordpress color picker isn’t triggering a change.

    I have quite a bit of other code in canvas.js that is working.

    Thread Starter miturn

    (@miturn)

    Thanks Andrew.

    For the custom control, I registered a setting:

    $panel_manager->add_setting( 'theme_menu_color', array(
    		        'default'               =>  "#000000",
    		        'sanitize_callback'     =>  'tailor_sanitize_color',
    			'refresh' => array( 'theme' => 'js', ),
    		    ) );

    And then in canvas.js:

    SettingAPI.onChange( 'sidebar:theme_menu_color', function( to, from ) {
    		$('.theme-label').css({'color' : to });
        } );

    It works once the page is refreshed. Just not the live js update.

Viewing 3 replies - 1 through 3 (of 3 total)