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

Make sticky nav display widths filterable #1261

Closed
benlk opened this issue Aug 1, 2016 · 0 comments
Closed

Make sticky nav display widths filterable #1261

benlk opened this issue Aug 1, 2016 · 0 comments

Comments

@benlk
Copy link
Collaborator

benlk commented Aug 1, 2016

In many places in js/navigation.js there are lines like this:

    if ($(window).width() > 768) {
      this.stickyNavTransition();
    }

These 768s should not be hardcoded, but rather drawn from the Largo javascript object created in inc/enqueue.php and should be made filterable, with code similar to this:

        wp_localize_script(
            'largoCore', 'Largo', array(
            'is_home' => is_home(),
            'is_single' => is_single() || is_singular(),
            'sticky_nav_options' => array(
                'sticky_nav_display_article' => (bool) of_get_option( 'sticky_nav_display_article', 1 ),
                'main_nav_hide_article' => (bool) of_get_option( 'main_nav_hide_article', 0 ),
                'nav_overflow_label' => of_get_option( 'nav_overflow_label', 'More' ),
                'sticky_nav_breakpoint' => apply_filters( 'largo_sticky_nav_breakpoint', 768 )
            )
        ));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant