diff --git a/CHANGELOG.md b/CHANGELOG.md index d11b1098d6eae46f87ec4abef3eaf1ca32c8cd7d..b7a245a05d1177ea5f2e6e4ce48b95aaf6a55535 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.5.1] - 09-05-2019 + +- Fixed issue of mega menu not working on specific versions of IE + ## [2.5.0] - 25-04-2019 diff --git a/cern_components.info.yml b/cern_components.info.yml index 2bd5e970d09a7ee8767e99cc5ab9d0c3703a7278..bfc747d274030dee8f6f0c776054a5473cffcae7 100755 --- a/cern_components.info.yml +++ b/cern_components.info.yml @@ -2,7 +2,7 @@ name: "CERN Components" type: module description: "Provides all the necessary modules regarding CERN Web Components." core: 8.x -version: 2.5.0 +version: 2.5.1 package: CERN Components dependencies: - components:components (>=8.x-1.1-alpha1) diff --git a/patterns/molecules/header-blocks/js/android-fix.js b/patterns/molecules/header-blocks/js/android-fix.js index 09f43439eb2cc403bd30ea3b76d6730fd2c556c3..150579319a9d759b2d54a1ccb4f3a9d4a8cf6b9b 100644 --- a/patterns/molecules/header-blocks/js/android-fix.js +++ b/patterns/molecules/header-blocks/js/android-fix.js @@ -1,5 +1,5 @@ var ua = navigator.userAgent; -if (ua.includes('Chrome') && ua.includes('Mobile')) { +if (ua.indexOf('Chrome') > -1 && ua.indexOf('Mobile') > -1) { (function ($) { $(document).ready(function() { $('.owl-dots').first().css('bottom', '55px'); diff --git a/patterns/molecules/menu/js/menu.component.js b/patterns/molecules/menu/js/menu.component.js index dab2931c0089a3b192202be96621dd8f296cfb6a..ab845e361fd94995fd6d492addd12f1a3fd94050 100644 --- a/patterns/molecules/menu/js/menu.component.js +++ b/patterns/molecules/menu/js/menu.component.js @@ -75,13 +75,13 @@ function setSearchPlaceholder() { if (jQuery(window).width() >= 767) { $(".cern-menu-search").each(function(){ - let placeholderSearch = $(this).find(".placeholder-of-search").text(); + var placeholderSearch = $(this).find(".placeholder-of-search").text(); $(this).find("input.form-search").attr("placeholder", placeholderSearch); $(this).find("input.form-search").removeAttr("data-original-title"); }); } else { $(".cern-menu-search").each(function(){ - let placeholderSearch = $(this).find(".placeholder-of-search-mobile").text(); + var placeholderSearch = $(this).find(".placeholder-of-search-mobile").text(); $(this).find("input.form-search").attr("placeholder", placeholderSearch); $(this).find("input.form-search").removeAttr("data-original-title"); }); @@ -104,9 +104,9 @@ break; } - matched_links = jQuery('li.cern-dropdown').find('a[href^="'+ previous_path +'"]'); - if ((matched_links.length > 1 && current_search != '') || matched_links.length == 1) { - jQuery('li.cern-dropdown').find('a[href^="'+ previous_path + current_search + '"]').closest('.cern-submenu').find('.cernmenu-level-0 a').addClass('active-trail'); + matched_links = jQuery('li.cern-dropdown').find('a[href^="'+ previous_path +'"]'); + if ((matched_links.length > 1 && current_search != '') || matched_links.length == 1) { + jQuery('li.cern-dropdown').find('a[href^="'+ previous_path + current_search + '"]').closest('.cern-submenu').find('.cernmenu-level-0 a').addClass('active-trail'); jQuery('li.cern-dropdown').find('a[href^="'+ previous_path + current_search + '"]').addClass('active-trail'); break; } else { @@ -114,19 +114,19 @@ matched_links.closest('.cern-submenu').find('.cernmenu-level-0 a').addClass('active-trail'); } } - current_path.pop(); + current_path.pop(); } - + if (matched_links.length == 1) { // make a row children link active matched_links.eq(0).addClass('active-trail'); - } - + } + if(matched_links.length >= 1) { // make a parent as active matched_links.eq(0).closest('.cern-dropdown').find('a.dropdown-toggle').eq(0).addClass('active-trail'); } } /** END ACTIVE TRAIL */ - -})(jQuery, Drupal); + +})(jQuery, Drupal);