Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color-alpha not live updating. #722

Closed
enkota opened this issue Mar 6, 2016 · 8 comments
Closed

Color-alpha not live updating. #722

enkota opened this issue Mar 6, 2016 · 8 comments

Comments

@enkota
Copy link

enkota commented Mar 6, 2016

Hey @aristath I know you mentioned working on the JS vars auto updating but the Colour-alpha output isn't live updating currently. Not sure if this is related to #694 ?

Cheers! :)

@aristath
Copy link
Contributor

aristath commented Mar 6, 2016

Can you post the field's configuration please?

@enkota
Copy link
Author

enkota commented Mar 6, 2016

Sure, just to clarify; the overlay color updates after saving and closing but the live changes aren't visible 👍

//Image Background Color
Kirki::add_field( 'kirki', array(
    'type'        => 'color',
    'settings'     => 'kirki_img_color',
    'label'       => __( 'Image Background Color', 'kirki' ),
    'description' => __( 'Pick the image background color.', 'kirki' ),
    'priority'    => 20,
    'default'     => '#222',
    'active_callback' => '__return_false',
    'section'     => 'kirki_image_options',
) );

//Image Overlay Color
Kirki::add_field( 'kirki', array(
    'type'        => 'color-alpha',
    'settings'    => 'color_alpha_options',
    'label'       => esc_attr__( 'Overlay Color/Opacity', 'kirki' ),
    'description' => esc_attr__( 'Change the overlay color and opacity for background images', 'kirki-options' ),
    'section'     => 'kirki_image_options',
    'default'     => 'rgba(0,0,0,0.3)',
    'priority'    => 20,
    'output'      => array(
        array(
            'element'  => array(
                '.layer',
                '.layer-2',
            ),
            'property' => 'background-color',
        ),
    ),
) );

@aristath
Copy link
Contributor

aristath commented Mar 6, 2016

Why do you have 'active_callback' => '__return_false', in there???

@aristath
Copy link
Contributor

aristath commented Mar 6, 2016

@scopeak I disabled the automatic js_vars generation from the output, it's not yet mature enough for production.
Test it again and let me know if it works for you now that I disabled it...

@enkota
Copy link
Author

enkota commented Mar 6, 2016

Sure thing and I have that in as I don't need the first colour field. I thought we needed it for the alpha one to work?

Edit: Just downloaded latest version, there's a parse error in there I believe 👍
Parse error: syntax error, unexpected 'return' (T_RETURN) in /kirki/includes/class-kirki-explode-background-field.php on line 157

@aristath
Copy link
Contributor

aristath commented Mar 6, 2016

I thought we needed it for the alpha one to work?

Nope, not anymore... that was last year. Since then I was able to fix that issue 👍

@enkota
Copy link
Author

enkota commented Mar 6, 2016

Nice! I'll just remove that then, thanks again 👍

@aristath aristath closed this as completed Mar 6, 2016
@enkota
Copy link
Author

enkota commented Mar 6, 2016

@aristath You had a ; missing in class-kirks-explode-background-field.php on line 157

$i18n = Kirki_l10n::get_strings();

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants