Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions inc/class-wp-bootstrap-navwalker.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0
$atts['class'][] = 'dropdown-toggle';
if ( ! $this->hover ) {
$atts['data-toggle'] = 'dropdown';
$atts['href'] = '#';
}
} else {
$collpse_as_button = apply_filters( 'cpschool_nav_collapse_as_button', false, $item, $args, $depth );
Expand All @@ -264,7 +263,7 @@ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0
if ( ! $collpse_as_button ) {
$atts['class'][] = 'collapse-toggle';
$atts['data-toggle'] = 'collapse';
$atts['href'] = '#' . $data_target;
$atts['data-target'] = '#' . $data_target;
}
} else {
if ( ! $collpse_as_button ) {
Expand Down
14 changes: 13 additions & 1 deletion js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -7468,8 +7468,20 @@ var cpSchoolThemeHelpers = function ($) {
}
}
});
} // This will make vars in css work in IE11.
}

$('a.collapse-toggle').on('touchend', function (e) {
var isExpanded = $(this).attr('aria-expanded');

if (isExpanded === 'true') {
e.preventDefault();
var link = $(this).attr('href');

if (!link.startsWith('#')) {
window.location = link;
}
}
}); // This will make vars in css work in IE11.

if (typeof cssVars === "function") {
cssVars({
Expand Down
2 changes: 1 addition & 1 deletion js/theme.min.js

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion src/js/custom-javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,21 @@
});
}

$('nav.menu-mobile a.collapse-toggle').on('touchend', function(e) {
var isExpanded = $(this).attr('aria-expanded');
if(isExpanded === 'true') {
e.preventDefault();
var link = $(this).attr('href');
if (!link.startsWith('#')) {
window.location = link;
}
}
})

// This will make vars in css work in IE11.
if (typeof cssVars === "function") {
cssVars({
preserveStatic: false
});
}
})(jQuery);
})(jQuery);