Created
July 6, 2016 19:02
-
-
Save joshfeck/c4c9d36061eed451370c06199473443a to your computer and use it in GitHub Desktop.
Divi theme JavaScript fix for Event Espresso MER cart button.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// around line 739 of Divi's custom.js file, you'll find this: | |
$( 'a[href*="#"]:not([href="#"])' ).click( function() { | |
var $this_link = $( this ), | |
has_closest_smooth_scroll_disabled = $this_link.closest( '.et_smooth_scroll_disabled' ).length, | |
has_closest_woocommerce_tabs = ( $this_link.closest( '.woocommerce-tabs' ).length && $this_link.closest( '.tabs' ).length ), | |
has_closest_eab_cal_link = $this_link.closest( '.eab-shortcode_calendar-navigation-link' ).length, | |
has_acomment_reply = $this_link.hasClass( 'acomment-reply' ), | |
disable_scroll = has_closest_smooth_scroll_disabled || has_closest_woocommerce_tabs || has_closest_eab_cal_link || has_acomment_reply; | |
// change to this: | |
$( 'a[href*="#"]:not([href="#"])' ).click( function() { | |
var $this_link = $( this ), | |
has_closest_smooth_scroll_disabled = $this_link.closest( '.et_smooth_scroll_disabled' ).length, | |
has_closest_woocommerce_tabs = ( $this_link.closest( '.woocommerce-tabs' ).length && $this_link.closest( '.tabs' ).length ), | |
has_closest_eab_cal_link = $this_link.closest( '.eab-shortcode_calendar-navigation-link' ).length, | |
has_closest_ee_cart_link = $this_link.closest( '.view-cart-lnk' ).length, | |
has_acomment_reply = $this_link.hasClass( 'acomment-reply' ), | |
disable_scroll = has_closest_smooth_scroll_disabled || has_closest_ee_cart_link || has_closest_woocommerce_tabs || has_closest_eab_cal_link || has_acomment_reply; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment