- Issue created by @sonam_sharma
- Status changed to Needs work
over 1 year ago 11:00am 3 July 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
The issue summary should always describe what should be fixed/changed. Neither the title nor screenshots are sufficient to describe what the issue is, even in the case a patch is provided.
In the case of a bug, the description should also list the steps necessary to reproduce the issue, starting from when the module/theme is installed. - Status changed to RTBC
over 1 year ago 7:04am 20 July 2023 Hi @sonam_sharma,
Verified patch #2 on 9.5.8, menu-toggle is working fine on mobile view. Added screenshots for reference, moving to RTBC.
Thanks- Status changed to Needs work
over 1 year ago 8:29am 21 July 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
-(function(jQuery){ - Drupal.behaviors.awesome = { - attach: function (context, settings) { - // Your custom JavaScript goes inside this function... - jQuery('.mobile-menu', context).click(function () { - jQuery(this).next('.primary-menu-wrapper').toggleClass('active-menu'); - }); - jQuery('.close-mobile-menu', context).click(function () { - jQuery(this).closest('.primary-menu-wrapper').toggleClass('active-menu'); - }); - // Full page search. - jQuery('.search-icon').on('click', function() { - jQuery('.search-box').addClass('open'); - return false; - }); - - jQuery('.search-box-close').on('click', function() { - jQuery('.search-box').removeClass('open'); - return false; - }); - - // Scroll To Top. - jQuery(window).scroll(function () { - if (jQuery(this).scrollTop() > 80) { - jQuery('.scrolltop').fadeIn('slow'); - } else { - jQuery('.scrolltop').fadeOut('slow'); - } - }); - jQuery('.scrolltop').click(function () { - jQuery('html, body').animate( { scrollTop: 0 }, 'slow'); - }); - } - }; -})(jQuery); +jQuery(document).ready(function ($) { + // Your custom JavaScript goes inside this function... + $(".mobile-menu").click(function () { + $(this).next(".primary-menu-wrapper").toggleClass("active-menu"); + }); + $(".close-mobile-menu").click(function () { + $(this).closest(".primary-menu-wrapper").toggleClass("active-menu"); + }); + // Full page search. + $(".search-icon").on("click", function () { + $(".search-box").addClass("open"); + return false; + }); + + $(".search-box-close").on("click", function () { + $(".search-box").removeClass("open"); + return false; + }); + + // Scroll To Top. + $(window).scroll(function () { + if ($(this).scrollTop() > 80) { + $(".scrolltop").fadeIn("slow"); + } else { + $(".scrolltop").fadeOut("slow"); + } + }); + $(".scrolltop").click(function () { + $("html, body").animate({ scrollTop: 0 }, "slow"); + }); +});
Drupal modules and themes use Drupal behaviors → , not
jQuery(document).ready()
. That change is not correct. - Assigned to Akshay kashyap
- 🇮🇳India Akshay kashyap
I have created a patch to fix the toggle issue in mobile devices. I have added a Drupal behavior and put all the code inside the Drupal behavior. Please review.
- Status changed to Needs review
over 1 year ago 11:45am 3 August 2023 - Issue was unassigned.
- Status changed to RTBC
over 1 year ago 9:43am 16 August 2023 Verified the #11 patch on 9.5.8, the toggle is working for the login user. Added screenshots for reference, RTBC++