Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The mainMenuToggle behaviours in omega_kickstart.js are added mulitple times when a product variation is selected. this causes the menu to repeat itself.
I have applied a quick fix using jquery .once to only run these once. It seems the replaceWith behaviours in Drupal (I have 7.5) are re-applying these events.
Drupal.behaviors.mainMenuToggle = {
attach: function(context, settings) {
$('.region-menu .navigation').once("before", function () {
$('.region-menu .navigation').before('<a href="#" class="menu-toggle" title="' + Drupal.t("Toggle Menu") + '">' +
'<span class="line first-line first"></span>' +
'<span class="line"></span>' +
'<span class="line"></span>' +
'<span class="line last-line last"></span>' +
'<span class="toggle-help">' + Drupal.t("Menu") + '</span></a>');
});
$('.navigation .primary-menu h2, .navigation .second-menu h2').removeClass('element-invisible');
$('.region-menu .menu-toggle').once("click", function () {
$('.region-menu .menu-toggle').click(function(){
$('.navigation').slideToggle();
});
});
}
};
Comments
Comment #2
historysa CreditAttribution: historysa commented