Max Mega Menu - Version 2.5.3

Version Description

  • New: Animated Menu Toggle Block
  • Fix: Unable to change the number of columns on a newly added menu items within the "Mega Menu - Standard Layout" sub menu builder
  • Fix: Hide on mobile/desktop options for items within Mega Menu - Grid Layout sub menus
  • Fix: Residual Styling for :before :after pseudo elements
  • Fix: Conflict with uikit.js
  • Fix: Calculate dynamic submenu widths on page load (thanks to floq-design for the suggested fix!)
  • Fix: Remove hover styling from top level menu items on mobile (as Safari continues to apply the hover styling even once the item is deselected). How to apply hover styling for your mobile menu
  • Fix: Close mobile menu when page background is clicked
  • Fix: Compatibility with Elementor Pro sticky header
  • Fix: Residual styling on span.mega-indicator
Download this release

Release Info

Developer megamenu
Plugin Icon 128x128 Max Mega Menu
Version 2.5.3
Comparing to
See all releases

Code changes from version 2.5.2 to 2.5.3

classes/settings.class.php CHANGED
@@ -3242,8 +3242,8 @@ class Mega_Menu_Settings {
3242
  ),
3243
  'mobile_background_hover' => array(
3244
  'priority' => 45,
3245
- 'title' => __( "Menu Item Background (Hover)", "megamenu" ),
3246
- 'description' => __( "The background color for each top level item the mobile menu on hover (or when the menu item is clicked/active).", "megamenu" ),
3247
  'settings' => array(
3248
  array(
3249
  'title' => __( "From", "megamenu" ),
@@ -3287,8 +3287,8 @@ class Mega_Menu_Settings {
3287
  ),
3288
  'mobile_menu_item_font_hover' => array(
3289
  'priority' => 55,
3290
- 'title' => __( "Font (Hover)", "megamenu" ),
3291
- 'description' => __( "The font color to use for each top level menu item in the mobile menu on hover (or when the menu item is clicked/active).", "megamenu" ),
3292
  'settings' => array(
3293
  array(
3294
  'title' => __( "Color", "megamenu" ),
3242
  ),
3243
  'mobile_background_hover' => array(
3244
  'priority' => 45,
3245
+ 'title' => __( "Menu Item Background (Active)", "megamenu" ),
3246
+ 'description' => __( "The background color for each top level menu item in the mobile menu when the sub menu is open.", "megamenu" ),
3247
  'settings' => array(
3248
  array(
3249
  'title' => __( "From", "megamenu" ),
3287
  ),
3288
  'mobile_menu_item_font_hover' => array(
3289
  'priority' => 55,
3290
+ 'title' => __( "Font (Active)", "megamenu" ),
3291
+ 'description' => __( "The font color for each top level menu item in the mobile menu when the sub menu is open.", "megamenu" ),
3292
  'settings' => array(
3293
  array(
3294
  'title' => __( "Color", "megamenu" ),
classes/style-manager.class.php CHANGED
@@ -202,7 +202,7 @@ final class Mega_Menu_Style_Manager {
202
  'panel_third_level_padding_right' => '0px',
203
  'panel_third_level_padding_top' => '0px',
204
  'panel_third_level_padding_bottom' => '0px',
205
- 'flyout_width' => '150px',
206
  'flyout_menu_background_from' => '#f1f1f1',
207
  'flyout_menu_background_to' => '#f1f1f1',
208
  'flyout_border_color' => '#ffffff',
@@ -569,7 +569,7 @@ final class Mega_Menu_Style_Manager {
569
  * _will_ become outdated as the plugin is updated and the menu HTML changes.
570
  *
571
  * Instead of using a custom SCSS file, override only the absolute minimum CSS in the
572
- * Menu Theme > Custom Styling section.
573
  */
574
  $scss = file_get_contents( MEGAMENU_PATH . trailingslashit('css') . 'mixin.scss' );
575
  $scss .= file_get_contents( MEGAMENU_PATH . trailingslashit('css') . 'reset.scss' );
@@ -590,6 +590,8 @@ final class Mega_Menu_Style_Manager {
590
 
591
  }
592
 
 
 
593
  return apply_filters( "megamenu_load_scss_file_contents", $scss);
594
 
595
  }
@@ -672,6 +674,15 @@ final class Mega_Menu_Style_Manager {
672
  $vars['menu'] = "'$menu_selector'";
673
  $vars['location'] = "'$sanitized_location'";
674
  $vars['menu_id'] = "'$menu_id'";
 
 
 
 
 
 
 
 
 
675
 
676
  $settings = $this->get_menu_settings_for_location( $location );
677
 
202
  'panel_third_level_padding_right' => '0px',
203
  'panel_third_level_padding_top' => '0px',
204
  'panel_third_level_padding_bottom' => '0px',
205
+ 'flyout_width' => '250px',
206
  'flyout_menu_background_from' => '#f1f1f1',
207
  'flyout_menu_background_to' => '#f1f1f1',
208
  'flyout_border_color' => '#ffffff',
569
  * _will_ become outdated as the plugin is updated and the menu HTML changes.
570
  *
571
  * Instead of using a custom SCSS file, override only the absolute minimum CSS in the
572
+ * Mega Menu > Menu Themes > Custom Styling section.
573
  */
574
  $scss = file_get_contents( MEGAMENU_PATH . trailingslashit('css') . 'mixin.scss' );
575
  $scss .= file_get_contents( MEGAMENU_PATH . trailingslashit('css') . 'reset.scss' );
590
 
591
  }
592
 
593
+ $scss .= file_get_contents( MEGAMENU_PATH . trailingslashit('css') . 'compatibility.scss' );
594
+
595
  return apply_filters( "megamenu_load_scss_file_contents", $scss);
596
 
597
  }
674
  $vars['menu'] = "'$menu_selector'";
675
  $vars['location'] = "'$sanitized_location'";
676
  $vars['menu_id'] = "'$menu_id'";
677
+ $vars['elementor_pro_active'] = 'false';
678
+
679
+ if ( ! function_exists( 'is_plugin_active' )) {
680
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
681
+ }
682
+
683
+ if ( function_exists( 'is_plugin_active' ) && is_plugin_active( 'elementor-pro/elementor-pro.php' ) ) {
684
+ $vars['elementor_pro_active'] = 'true';
685
+ }
686
 
687
  $settings = $this->get_menu_settings_for_location( $location );
688
 
classes/toggle-blocks.class.php CHANGED
@@ -20,6 +20,8 @@ class Mega_Menu_Toggle_Blocks {
20
 
21
  add_filter( 'megamenu_scss_variables', array( $this, 'add_menu_toggle_block_vars_to_scss'), 10, 5 );
22
  add_filter( 'megamenu_scss_variables', array( $this, 'add_spacer_block_vars_to_scss'), 10, 5 );
 
 
23
  add_filter( 'megamenu_load_scss_file_contents', array( $this, 'append_scss'), 10 );
24
  add_filter( 'megamenu_toggle_bar_content', array( $this, 'output_public_toggle_blocks' ), 10, 4 );
25
 
@@ -27,6 +29,12 @@ class Mega_Menu_Toggle_Blocks {
27
  add_action( 'megamenu_output_admin_toggle_block_menu_toggle', array( $this, 'output_menu_toggle_block_html'), 10, 2 );
28
  add_action( 'megamenu_output_public_toggle_block_menu_toggle', array( $this, 'output_menu_public_toggle_block_html'), 10, 2 );
29
 
 
 
 
 
 
 
30
  add_action( 'wp_ajax_mm_get_toggle_block_spacer', array( $this, 'output_spacer_block_html' ) );
31
  add_action( 'megamenu_output_admin_toggle_block_spacer', array( $this, 'output_spacer_block_html'), 10, 2 );
32
 
@@ -575,6 +583,69 @@ class Mega_Menu_Toggle_Blocks {
575
 
576
  }
577
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
578
 
579
  /**
580
  * Print the toggle bar designer option
@@ -590,6 +661,7 @@ class Mega_Menu_Toggle_Blocks {
590
  $block_types = apply_filters("megamenu_registered_toggle_blocks", array(
591
  'title' => __("Add block to toggle bar", "megamenu"),
592
  'menu_toggle' => __("Menu Toggle", "megamenu"),
 
593
  'spacer' => __("Spacer", "megamenu")
594
  ));
595
 
@@ -734,7 +806,7 @@ class Mega_Menu_Toggle_Blocks {
734
  ?>
735
 
736
  <div class='block'>
737
- <div class='block-title'><?php _e("MENU", "megamenu"); ?> <span title='<?php _e("Menu Toggle", "megamenu"); ?>' class="dashicons dashicons-menu"></span></div>
738
  <div class='block-settings'>
739
  <h3><?php _e("Menu Toggle Settings", "megamenu") ?></h3>
740
  <input type='hidden' class='type' name='toggle_blocks[<?php echo $block_id; ?>][type]' value='menu_toggle' />
@@ -781,6 +853,77 @@ class Mega_Menu_Toggle_Blocks {
781
  }
782
 
783
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
784
  /**
785
  * Print an icon selection box
786
  *
20
 
21
  add_filter( 'megamenu_scss_variables', array( $this, 'add_menu_toggle_block_vars_to_scss'), 10, 5 );
22
  add_filter( 'megamenu_scss_variables', array( $this, 'add_spacer_block_vars_to_scss'), 10, 5 );
23
+ add_filter( 'megamenu_scss_variables', array( $this, 'add_menu_toggle_animated_block_vars_to_scss'), 10, 5 );
24
+
25
  add_filter( 'megamenu_load_scss_file_contents', array( $this, 'append_scss'), 10 );
26
  add_filter( 'megamenu_toggle_bar_content', array( $this, 'output_public_toggle_blocks' ), 10, 4 );
27
 
29
  add_action( 'megamenu_output_admin_toggle_block_menu_toggle', array( $this, 'output_menu_toggle_block_html'), 10, 2 );
30
  add_action( 'megamenu_output_public_toggle_block_menu_toggle', array( $this, 'output_menu_public_toggle_block_html'), 10, 2 );
31
 
32
+
33
+ add_action( 'wp_ajax_mm_get_toggle_block_menu_toggle_animated', array( $this, 'output_menu_toggle_block_animated_html' ) );
34
+ add_action( 'megamenu_output_admin_toggle_block_menu_toggle_animated', array( $this, 'output_menu_toggle_block_animated_html'), 10, 2 );
35
+ add_action( 'megamenu_output_public_toggle_block_menu_toggle_animated', array( $this, 'output_menu_public_toggle_block_animated_html'), 10, 2 );
36
+
37
+
38
  add_action( 'wp_ajax_mm_get_toggle_block_spacer', array( $this, 'output_spacer_block_html' ) );
39
  add_action( 'megamenu_output_admin_toggle_block_spacer', array( $this, 'output_spacer_block_html'), 10, 2 );
40
 
583
 
584
  }
585
 
586
+ /**
587
+ * Create a new variable containing the animated menu toggle blocks to be used by the SCSS file
588
+ *
589
+ * @param array $vars
590
+ * @param string $location
591
+ * @param string $theme
592
+ * @param int $menu_id
593
+ * @param string $theme_id
594
+ * @return array - all custom SCSS vars
595
+ * @since 2.5.3
596
+ */
597
+ public function add_menu_toggle_animated_block_vars_to_scss( $vars, $location, $theme, $menu_id, $theme_id ) {
598
+
599
+ $toggle_blocks = $this->get_toggle_blocks_for_theme( $theme_id );
600
+
601
+ $menu_toggle_animated_blocks = array();
602
+
603
+ if ( is_array( $toggle_blocks ) ) {
604
+
605
+ foreach( $toggle_blocks as $index => $settings ) {
606
+
607
+ if ( isset( $settings['type'] ) && $settings['type'] == 'menu_toggle_animated' ) {
608
+
609
+ $styles = array(
610
+ 'id' => $index,
611
+ 'icon_scale' => isset($settings['icon_scale']) && strlen($settings['icon_scale']) ? $settings['icon_scale'] : "0.8",
612
+ 'icon_color' => isset($settings['icon_color']) ? $settings['icon_color'] : 'rgb(221, 221, 221)',
613
+ );
614
+
615
+ $menu_toggle_animated_blocks[ $index ] = $styles;
616
+ }
617
+
618
+ }
619
+ }
620
+
621
+ //$menu_toggle_blocks(
622
+ // (123, red, 150px),
623
+ // (456, green, null),
624
+ // (789, blue, 90%),());
625
+ if ( count( $menu_toggle_animated_blocks ) ) {
626
+
627
+ $list = "(";
628
+
629
+ foreach ( $menu_toggle_animated_blocks as $id => $vals ) {
630
+ $list .= "(" . implode( ",", $vals ) . "),";
631
+ }
632
+
633
+ // Always add an empty list item to meke sure there are always at least 2 items in the list
634
+ // Lists with a single item are not treated the same way by SASS
635
+ $list .= "());";
636
+
637
+ $vars['menu_toggle_animated_blocks'] = $list;
638
+
639
+ } else {
640
+
641
+ $vars['menu_toggle_animated_blocks'] = "()";
642
+
643
+ }
644
+
645
+ return $vars;
646
+
647
+ }
648
+
649
 
650
  /**
651
  * Print the toggle bar designer option
661
  $block_types = apply_filters("megamenu_registered_toggle_blocks", array(
662
  'title' => __("Add block to toggle bar", "megamenu"),
663
  'menu_toggle' => __("Menu Toggle", "megamenu"),
664
+ 'menu_toggle_animated' => __("Menu Toggle Animated", "megamenu"),
665
  'spacer' => __("Spacer", "megamenu")
666
  ));
667
 
806
  ?>
807
 
808
  <div class='block'>
809
+ <div class='block-title'><?php _e("TOGGLE", "megamenu"); ?> <span title='<?php _e("Menu Toggle", "megamenu"); ?>' class="dashicons dashicons-menu"></span></div>
810
  <div class='block-settings'>
811
  <h3><?php _e("Menu Toggle Settings", "megamenu") ?></h3>
812
  <input type='hidden' class='type' name='toggle_blocks[<?php echo $block_id; ?>][type]' value='menu_toggle' />
853
  }
854
 
855
 
856
+ /**
857
+ * Output the menu toggle block (front end)
858
+ *
859
+ * @since 2.5.3
860
+ * @param string $html
861
+ * @param array $settings
862
+ * @return string
863
+ */
864
+ public function output_menu_public_toggle_block_animated_html( $html, $settings ) {
865
+ $style = isset( $settings['style'] ) ? $settings['style'] : "slider";
866
+
867
+ $html = '<button class="mega-toggle-animated mega-toggle-animated-' . $style . '" type="button">
868
+ <span class="mega-toggle-animated-box">
869
+ <span class="mega-toggle-animated-inner"></span>
870
+ </span>
871
+ </button>';
872
+
873
+ return apply_filters("megamenu_toggle_menu_toggle_animated_html", $html);
874
+
875
+ }
876
+
877
+ /**
878
+ * Output the HTML for the "Menu Toggle (Animated)" block settings
879
+ *
880
+ * @since 2.5.3
881
+ * @param int $block_id
882
+ * @param array $settings
883
+ */
884
+ public function output_menu_toggle_block_animated_html( $block_id, $settings = array() ) {
885
+
886
+ if ( empty( $settings ) ) {
887
+ $block_id = "0";
888
+ }
889
+
890
+ $defaults = array(
891
+ 'icon_scale' => '0.8',
892
+ 'icon_color' => 'rgb(221, 221, 221)'
893
+ );
894
+
895
+ $settings = array_merge( $defaults, $settings );
896
+
897
+ ?>
898
+
899
+ <div class='block'>
900
+ <div class='block-title'><?php _e("TOGGLE", "megamenu"); ?> <span title='<?php _e("Menu Toggle", "megamenu"); ?>' class="dashicons dashicons-menu"></span></div>
901
+ <div class='block-settings'>
902
+ <h3><?php _e("Animated Menu Toggle Settings", "megamenu") ?></h3>
903
+ <input type='hidden' class='type' name='toggle_blocks[<?php echo $block_id; ?>][type]' value='menu_toggle_animated' />
904
+ <input type='hidden' class='align' name='toggle_blocks[<?php echo $block_id; ?>][align]' value='<?php echo $settings['align'] ?>'>
905
+ <input type='hidden' class='style' name='toggle_blocks[<?php echo $block_id; ?>][style]' value='slider'>
906
+
907
+ <label>
908
+ <?php _e("Color", "megamenu") ?>
909
+ <?php $this->print_toggle_color_option( 'icon_color', $block_id, $settings['icon_color'] ); ?>
910
+ </label>
911
+ <label>
912
+ <?php _e("Size", "megamenu") ?><select name='toggle_blocks[<?php echo $block_id; ?>][icon_scale]'>
913
+ <option value='0.6' <?php selected( $settings['icon_scale'], "0.6" ) ?> ><?php _e("Small", "megamenu") ?></option>
914
+ <option value='0.8' <?php selected( $settings['icon_scale'], "0.8" ) ?> ><?php _e("Medium", "megamenu") ?></option>
915
+ <option value='1.0' <?php selected( $settings['icon_scale'], "1.0" ) ?> ><?php _e("Large", "megamenu") ?></option>
916
+ <option value='1.2' <?php selected( $settings['icon_scale'], "1.2" ) ?> ><?php _e("X Large", "megamenu") ?></option>
917
+ </select>
918
+ </label>
919
+ <a class='mega-delete'><?php _e("Delete", "megamenu"); ?></a>
920
+ </div>
921
+ </div>
922
+
923
+ <?php
924
+ }
925
+
926
+
927
  /**
928
  * Print an icon selection box
929
  *
classes/widget-manager.class.php CHANGED
@@ -984,11 +984,17 @@ class Mega_Menu_Widget_Manager {
984
  */
985
  public function update_menu_item_columns( $menu_item_id, $columns ) {
986
 
987
- $settings = get_post_meta( $menu_item_id, '_megamenu', true);
988
 
989
- $settings['mega_menu_columns'] = absint( $columns );
 
 
990
 
991
- update_post_meta( $menu_item_id, '_megamenu', $settings );
 
 
 
 
992
 
993
  return true;
994
 
984
  */
985
  public function update_menu_item_columns( $menu_item_id, $columns ) {
986
 
987
+ $existing_settings = get_post_meta( $menu_item_id, '_megamenu', true);
988
 
989
+ $submitted_settings = array(
990
+ 'mega_menu_columns' => absint( $columns )
991
+ );
992
 
993
+ if ( is_array( $existing_settings ) ) {
994
+ $submitted_settings = array_merge( $existing_settings, $submitted_settings );
995
+ }
996
+
997
+ update_post_meta( $menu_item_id, '_megamenu', $submitted_settings );
998
 
999
  return true;
1000
 
css/admin/admin.css CHANGED
@@ -1829,14 +1829,18 @@ body.toplevel_page_maxmegamenu .megamenu_right {
1829
  font-size: 1em; }
1830
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .block-settings label input,
1831
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .block-settings label select,
1832
- body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .block-settings label input,
1833
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .block-settings label .icon_dropdown,
1834
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .block-settings label input,
1835
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .block-settings label select,
1836
- body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .block-settings label input,
1837
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .block-settings label .icon_dropdown {
1838
  float: right;
1839
  font-size: 0.9em; }
 
 
 
 
1840
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .toggle-left,
1841
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .toggle-left {
1842
  border-right: 1px dashed #ccc; }
1829
  font-size: 1em; }
1830
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .block-settings label input,
1831
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .block-settings label select,
1832
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .block-settings label input[type=number],
1833
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .block-settings label .icon_dropdown,
1834
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .block-settings label input,
1835
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .block-settings label select,
1836
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .block-settings label input[type=number],
1837
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .block-settings label .icon_dropdown {
1838
  float: right;
1839
  font-size: 0.9em; }
1840
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .block-settings label input[type=number],
1841
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .block-settings label input[type=number] {
1842
+ height: 28px;
1843
+ line-height: 28px; }
1844
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .toggle-left,
1845
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table label.mega-toggle_blocks .toggle-bar-designer .toggle-left {
1846
  border-right: 1px dashed #ccc; }
css/admin/admin.scss CHANGED
@@ -2370,12 +2370,17 @@ body.toplevel_page_maxmegamenu {
2370
 
2371
  .block-settings label input,
2372
  .block-settings label select,
2373
- .block-settings label input,
2374
  .block-settings label .icon_dropdown {
2375
  float: right;
2376
  font-size: 0.9em;
2377
  }
2378
 
 
 
 
 
 
2379
  .toggle-left {
2380
  border-right: 1px dashed #ccc;
2381
  }
2370
 
2371
  .block-settings label input,
2372
  .block-settings label select,
2373
+ .block-settings label input[type=number],
2374
  .block-settings label .icon_dropdown {
2375
  float: right;
2376
  font-size: 0.9em;
2377
  }
2378
 
2379
+ .block-settings label input[type=number] {
2380
+ height: 28px;
2381
+ line-height: 28px;
2382
+ }
2383
+
2384
  .toggle-left {
2385
  border-right: 1px dashed #ccc;
2386
  }
css/compatibility.scss ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ @if ($elementor_pro_active == true) {
2
+ .elementor-sticky__spacer #{$wrap} #{$menu},
3
+ .elementor-sticky__spacer #{$wrap} #{$menu} .mega-sub-menu {
4
+ visibility: inherit !important;
5
+ }
6
+ }
css/megamenu.scss CHANGED
@@ -17,9 +17,6 @@
17
  #{$wrap} #{$menu} li.mega-menu-row,
18
  #{$wrap} #{$menu} li.mega-menu-column,
19
  #{$wrap} #{$menu} a.mega-menu-link {
20
- -moz-transition: none;
21
- -o-transition: none;
22
- -webkit-transition: none;
23
  transition: none;
24
  @include border-radius(0, 0, 0, 0);
25
  @include box-shadow(none);
@@ -64,39 +61,44 @@
64
  }
65
 
66
  #{$wrap} {
67
- @include background($container_background_from, $container_background_to);
 
 
 
68
  @include border-radius($container_border_radius_top_left, $container_border_radius_top_right, $container_border_radius_bottom_right, $container_border_radius_bottom_left);
69
 
70
- &.mega-keyboard-navigation .mega-menu-toggle:focus,
71
- &.mega-keyboard-navigation #{$menu} a:focus,
72
- &.mega-keyboard-navigation #{$menu} input:focus {
73
- @include box-shadow(inset 0px 0px 3px 1px #00FFFF);
74
- }
 
75
 
76
- #{$menu} {
77
- visibility: visible;
78
- text-align: $menu_item_align;
79
- padding: $container_padding_top $container_padding_right $container_padding_bottom $container_padding_left;
 
 
80
 
81
- @if $container_background_from != $mobile_background_from {
82
  @include mobile {
83
- @include background($mobile_background_from, $mobile_background_to);
 
84
  }
85
  }
 
86
 
87
- @include mobile {
88
- padding: 0;
89
- }
 
90
 
91
  a.mega-menu-link {
92
  cursor: pointer;
93
  display: inline;
94
 
95
  @if $transitions == 'on' {
96
- -webkit-transition: background 200ms linear, color 200ms linear;
97
- -moz-transition: background 200ms linear, color 200ms linear;
98
- -o-transition: background 200ms linear, color 200ms linear;
99
- transition: background 200ms linear, color 200ms linear;
100
  }
101
 
102
  .mega-description-group {
@@ -189,12 +191,9 @@
189
 
190
  @include desktop {
191
  &[data-effect="fade"] {
192
-
193
  li.mega-menu-item > ul.mega-sub-menu {
194
  opacity: 0;
195
- transition-duration: $effect_speed;
196
- transition-timing-function: ease-in;
197
- transition-property: opacity, visibility;
198
  }
199
 
200
  &.mega-no-js li.mega-menu-item:hover > ul.mega-sub-menu,
@@ -203,18 +202,14 @@
203
  li.mega-menu-item.mega-menu-megamenu.mega-toggle-on ul.mega-sub-menu {
204
  opacity: 1;
205
  }
206
-
207
  }
208
 
209
  &[data-effect="fade_up"] {
210
-
211
  li.mega-menu-item.mega-menu-megamenu > ul.mega-sub-menu,
212
  li.mega-menu-item.mega-menu-flyout ul.mega-sub-menu {
213
  opacity: 0;
214
- margin-top: 10px;
215
- transition-duration: $effect_speed;
216
- transition-timing-function: ease-in;
217
- transition-property: opacity, margin-top, visibility;
218
  }
219
 
220
  &.mega-no-js li.mega-menu-item:hover > ul.mega-sub-menu,
@@ -222,28 +217,23 @@
222
  li.mega-menu-item.mega-toggle-on > ul.mega-sub-menu,
223
  li.mega-menu-item.mega-menu-megamenu.mega-toggle-on ul.mega-sub-menu {
224
  opacity: 1;
225
- margin-top: 0;
226
  }
227
-
228
  }
229
 
230
  &[data-effect="slide_up"] {
231
-
232
  li.mega-menu-item.mega-menu-megamenu > ul.mega-sub-menu,
233
  li.mega-menu-item.mega-menu-flyout ul.mega-sub-menu {
234
- margin-top: 10px;
235
- transition-duration: $effect_speed;
236
- transition-timing-function: ease-in;
237
- transition-property: margin-top, visibility;
238
  }
239
 
240
  &.mega-no-js li.mega-menu-item:hover > ul.mega-sub-menu,
241
  &.mega-no-js li.mega-menu-item:focus > ul.mega-sub-menu,
242
  li.mega-menu-item.mega-toggle-on > ul.mega-sub-menu,
243
  li.mega-menu-item.mega-menu-megamenu.mega-toggle-on ul.mega-sub-menu {
244
- margin-top: 0;
245
  }
246
-
247
  }
248
  }
249
 
@@ -347,9 +337,17 @@
347
  }
348
  }
349
 
350
- &.mega-toggle-on > a.mega-menu-link,
351
- > a.mega-menu-link:hover,
352
- > a.mega-menu-link:focus {
 
 
 
 
 
 
 
 
353
  @include background($menu_item_background_hover_from, $menu_item_background_hover_to);
354
  color: $menu_item_link_color_hover;
355
  font-weight: $menu_item_link_weight_hover;
@@ -824,6 +822,8 @@
824
  background: transparent;
825
  height: auto;
826
  width: auto;
 
 
827
  }
828
 
829
  > a.mega-menu-link > span.mega-indicator {
@@ -834,6 +834,11 @@
834
  background: transparent;
835
  position: relative;
836
  pointer-events: auto;
 
 
 
 
 
837
 
838
  &:after {
839
  content: $arrow_up;
@@ -931,14 +936,16 @@
931
 
932
  @include mobile {
933
  li.mega-hide-on-mobile,
934
- > li.mega-menu-megamenu > ul.mega-sub-menu > li.mega-hide-on-mobile {
 
935
  display: none;
936
  }
937
  }
938
 
939
  @include desktop {
940
  li.mega-hide-on-desktop,
941
- > li.mega-menu-megamenu > ul.mega-sub-menu > li.mega-hide-on-desktop {
 
942
  display: none;
943
  }
944
  }
@@ -1070,7 +1077,9 @@
1070
 
1071
  @include mobile {
1072
  + #{$menu} {
1073
-
 
 
1074
  @if $disable_mobile_toggle == on {
1075
  display: block;
1076
  } @else {
17
  #{$wrap} #{$menu} li.mega-menu-row,
18
  #{$wrap} #{$menu} li.mega-menu-column,
19
  #{$wrap} #{$menu} a.mega-menu-link {
 
 
 
20
  transition: none;
21
  @include border-radius(0, 0, 0, 0);
22
  @include box-shadow(none);
61
  }
62
 
63
  #{$wrap} {
64
+ @include desktop {
65
+ @include background($container_background_from, $container_background_to);
66
+ }
67
+
68
  @include border-radius($container_border_radius_top_left, $container_border_radius_top_right, $container_border_radius_bottom_right, $container_border_radius_bottom_left);
69
 
70
+ &.mega-keyboard-navigation {
71
+ .mega-menu-toggle:focus,
72
+ #{$menu} a:focus,
73
+ #{$menu} input:focus {
74
+ @include box-shadow(inset 0px 0px 3px 1px #00FFFF);
75
+ }
76
 
77
+ > li.mega-menu-item > a.mega-menu-link:focus {
78
+ @include background($menu_item_background_hover_from, $menu_item_background_hover_to);
79
+ color: $menu_item_link_color_hover;
80
+ font-weight: $menu_item_link_weight_hover;
81
+ text-decoration: $menu_item_link_text_decoration_hover;
82
+ border-color: $menu_item_border_color_hover;
83
 
 
84
  @include mobile {
85
+ color: $mobile_menu_item_link_color_hover;
86
+ @include background($mobile_menu_item_background_hover_from, $mobile_menu_item_background_hover_to);
87
  }
88
  }
89
+ }
90
 
91
+ #{$menu} {
92
+ visibility: visible;
93
+ text-align: $menu_item_align;
94
+ padding: $container_padding_top $container_padding_right $container_padding_bottom $container_padding_left;
95
 
96
  a.mega-menu-link {
97
  cursor: pointer;
98
  display: inline;
99
 
100
  @if $transitions == 'on' {
101
+ transition: background 200ms linear, color 200ms linear, border 200ms linear;
 
 
 
102
  }
103
 
104
  .mega-description-group {
191
 
192
  @include desktop {
193
  &[data-effect="fade"] {
 
194
  li.mega-menu-item > ul.mega-sub-menu {
195
  opacity: 0;
196
+ transition: opacity $effect_speed ease-in, visibility $effect_speed ease-in;
 
 
197
  }
198
 
199
  &.mega-no-js li.mega-menu-item:hover > ul.mega-sub-menu,
202
  li.mega-menu-item.mega-menu-megamenu.mega-toggle-on ul.mega-sub-menu {
203
  opacity: 1;
204
  }
 
205
  }
206
 
207
  &[data-effect="fade_up"] {
 
208
  li.mega-menu-item.mega-menu-megamenu > ul.mega-sub-menu,
209
  li.mega-menu-item.mega-menu-flyout ul.mega-sub-menu {
210
  opacity: 0;
211
+ transform: translate(0, 10px);
212
+ transition: opacity $effect_speed ease-in, transform $effect_speed ease-in, visibility $effect_speed ease-in;
 
 
213
  }
214
 
215
  &.mega-no-js li.mega-menu-item:hover > ul.mega-sub-menu,
217
  li.mega-menu-item.mega-toggle-on > ul.mega-sub-menu,
218
  li.mega-menu-item.mega-menu-megamenu.mega-toggle-on ul.mega-sub-menu {
219
  opacity: 1;
220
+ transform: translate(0, 0);
221
  }
 
222
  }
223
 
224
  &[data-effect="slide_up"] {
 
225
  li.mega-menu-item.mega-menu-megamenu > ul.mega-sub-menu,
226
  li.mega-menu-item.mega-menu-flyout ul.mega-sub-menu {
227
+ transform: translate(0, 10px);
228
+ transition: transform $effect_speed ease-in, visibility $effect_speed ease-in;
 
 
229
  }
230
 
231
  &.mega-no-js li.mega-menu-item:hover > ul.mega-sub-menu,
232
  &.mega-no-js li.mega-menu-item:focus > ul.mega-sub-menu,
233
  li.mega-menu-item.mega-toggle-on > ul.mega-sub-menu,
234
  li.mega-menu-item.mega-menu-megamenu.mega-toggle-on ul.mega-sub-menu {
235
+ transform: translate(0, 0);
236
  }
 
237
  }
238
  }
239
 
337
  }
338
  }
339
 
340
+ @include desktop {
341
+ > a.mega-menu-link:hover {
342
+ @include background($menu_item_background_hover_from, $menu_item_background_hover_to);
343
+ color: $menu_item_link_color_hover;
344
+ font-weight: $menu_item_link_weight_hover;
345
+ text-decoration: $menu_item_link_text_decoration_hover;
346
+ border-color: $menu_item_border_color_hover;
347
+ }
348
+ }
349
+
350
+ &.mega-toggle-on > a.mega-menu-link {
351
  @include background($menu_item_background_hover_from, $menu_item_background_hover_to);
352
  color: $menu_item_link_color_hover;
353
  font-weight: $menu_item_link_weight_hover;
822
  background: transparent;
823
  height: auto;
824
  width: auto;
825
+ right: auto;
826
+ line-height: inherit;
827
  }
828
 
829
  > a.mega-menu-link > span.mega-indicator {
834
  background: transparent;
835
  position: relative;
836
  pointer-events: auto;
837
+ left: auto;
838
+ min-width: auto;
839
+ line-height: inherit;
840
+ color: inherit;
841
+ font-size: inherit;
842
 
843
  &:after {
844
  content: $arrow_up;
936
 
937
  @include mobile {
938
  li.mega-hide-on-mobile,
939
+ > li.mega-menu-megamenu > ul.mega-sub-menu > li.mega-hide-on-mobile,
940
+ > li.mega-menu-megamenu > ul.mega-sub-menu li.mega-menu-column > ul.mega-sub-menu > li.mega-menu-item.mega-hide-on-mobile {
941
  display: none;
942
  }
943
  }
944
 
945
  @include desktop {
946
  li.mega-hide-on-desktop,
947
+ > li.mega-menu-megamenu > ul.mega-sub-menu > li.mega-hide-on-desktop,
948
+ > li.mega-menu-megamenu > ul.mega-sub-menu li.mega-menu-column > ul.mega-sub-menu > li.mega-menu-item.mega-hide-on-desktop {
949
  display: none;
950
  }
951
  }
1077
 
1078
  @include mobile {
1079
  + #{$menu} {
1080
+ @include background($mobile_background_from, $mobile_background_to);
1081
+ padding: 0;
1082
+
1083
  @if $disable_mobile_toggle == on {
1084
  display: block;
1085
  } @else {
css/toggle-blocks.scss CHANGED
@@ -89,4 +89,103 @@
89
 
90
  }
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  }
89
 
90
  }
91
 
92
+ @each $item in $menu_toggle_animated_blocks {
93
+
94
+ $id: nth($item, 1);
95
+ $scale: nth($item, 2);
96
+ $color: nth($item, 3);
97
+
98
+ @if type-of($id) == number {
99
+
100
+ .mega-toggle-block-#{$id} {
101
+
102
+ /*!
103
+ * Hamburgers
104
+ * @description Tasty CSS-animated hamburgers
105
+ * @author Jonathan Suh @jonsuh
106
+ * @site https://jonsuh.com/hamburgers
107
+ * @link https://github.com/jonsuh/hamburgers
108
+ */
109
+ .mega-toggle-animated {
110
+ padding: 0;
111
+ display: -webkit-box;
112
+ display: -ms-flexbox;
113
+ display: -webkit-flex;
114
+ display: flex;
115
+ cursor: pointer;
116
+ transition-property: opacity, filter;
117
+ transition-duration: 0.15s;
118
+ transition-timing-function: linear;
119
+ font: inherit;
120
+ color: inherit;
121
+ text-transform: none;
122
+ background-color: transparent;
123
+ border: 0;
124
+ margin: 0;
125
+ overflow: visible;
126
+ transform: scale($scale);
127
+ }
128
+ .mega-toggle-animated-box {
129
+ width: 40px;
130
+ height: 24px;
131
+ display: inline-block;
132
+ position: relative;
133
+ }
134
+ .mega-toggle-animated-inner {
135
+ display: block;
136
+ top: 50%;
137
+ margin-top: -2px;
138
+ }
139
+ .mega-toggle-animated-inner,
140
+ .mega-toggle-animated-inner::before,
141
+ .mega-toggle-animated-inner::after {
142
+ width: 40px;
143
+ height: 4px;
144
+ background-color: $color;
145
+ border-radius: 4px;
146
+ position: absolute;
147
+ transition-property: transform;
148
+ transition-duration: 0.15s;
149
+ transition-timing-function: ease;
150
+ }
151
+ .mega-toggle-animated-inner::before,
152
+ .mega-toggle-animated-inner::after {
153
+ content: "";
154
+ display: block;
155
+ }
156
+ .mega-toggle-animated-inner::before {
157
+ top: -10px;
158
+ }
159
+ .mega-toggle-animated-inner::after {
160
+ bottom: -10px;
161
+ }
162
+ .mega-toggle-animated-slider .mega-toggle-animated-inner {
163
+ top: 2px;
164
+ }
165
+ .mega-toggle-animated-slider .mega-toggle-animated-inner::before {
166
+ top: 10px;
167
+ transition-property: transform, opacity;
168
+ transition-timing-function: ease;
169
+ transition-duration: 0.15s;
170
+ }
171
+ .mega-toggle-animated-slider .mega-toggle-animated-inner::after {
172
+ top: 20px;
173
+ }
174
+
175
+ }
176
+
177
+ &.mega-menu-open .mega-toggle-block-#{$id} {
178
+ .mega-toggle-animated-slider .mega-toggle-animated-inner {
179
+ transform: translate3d(0, 10px, 0) rotate(45deg);
180
+ }
181
+ .mega-toggle-animated-slider .mega-toggle-animated-inner::before {
182
+ transform: rotate(-45deg) translate3d(-5.71429px, -6px, 0);
183
+ opacity: 0;
184
+ }
185
+ .mega-toggle-animated-slider .mega-toggle-animated-inner::after {
186
+ transform: translate3d(0, -20px, 0) rotate(-90deg);
187
+ }
188
+ }
189
+ }
190
+ }
191
  }
js/maxmegamenu.js CHANGED
@@ -8,6 +8,7 @@
8
  $.maxmegamenu = function(menu, options) {
9
  var plugin = this;
10
  var $menu = $(menu);
 
11
 
12
  var defaults = {
13
  event: $menu.attr("data-event"),
@@ -131,7 +132,7 @@
131
 
132
  plugin.calculateDynamicSubmenuWidths = function(anchor) {
133
  // apply dynamic width and sub menu position (only to top level mega menus)
134
- if (anchor.parent().hasClass("mega-menu-megamenu") && anchor.parent().parent().hasClass('mega-menu') && plugin.settings.panel_width && $(plugin.settings.panel_width).length > 0) {
135
  if (plugin.isDesktopView()) {
136
  var submenu_offset = $menu.offset();
137
  var target_offset = $(plugin.settings.panel_width).offset();
@@ -149,7 +150,7 @@
149
  }
150
 
151
  // apply inner width to sub menu by adding padding to the left and right of the mega menu
152
- if (anchor.parent().hasClass("mega-menu-megamenu") && anchor.parent().parent().hasClass('mega-menu') && plugin.settings.panel_inner_width && $(plugin.settings.panel_inner_width).length > 0) {
153
  var target_width = 0;
154
 
155
  if ($(plugin.settings.panel_inner_width).length) {
@@ -187,16 +188,17 @@
187
  $(document).on("click touchend", function(e) { // hide menu when clicked away from
188
  if (!dragging && plugin.settings.document_click === "collapse" && ! $(e.target).closest(".max-mega-menu li").length && ! $(e.target).closest(".mega-menu-toggle").length ) {
189
  plugin.hideAllPanels();
 
190
  }
191
  dragging = false;
192
  });
193
 
194
- $("> a.mega-menu-link", items_with_submenus).on("click.megamenu touchend.megamenu", function(e) {
195
- if (e.type === 'touchend') {
196
- // prevent mouseenter events once touch has been detected
197
- plugin.unbindHoverEvents();
198
- plugin.unbindHoverIntentEvents();
199
- }
200
  if (plugin.isDesktopView() && $(this).parent().hasClass("mega-toggle-on") && $(this).parent().parent().parent().hasClass("mega-menu-tabbed") ) {
201
  if (plugin.settings.second_click === "go") {
202
  return;
@@ -279,7 +281,7 @@
279
  plugin.hideAllPanels();
280
 
281
  if ( plugin.isMobileView() ) {
282
- $menu.siblings('.mega-menu-toggle').removeClass('mega-menu-open');
283
  }
284
  }
285
  });
@@ -298,7 +300,7 @@
298
  }
299
 
300
  if ( active_link.hasClass("mega-menu-toggle") ) {
301
- active_link.addClass("mega-menu-open");
302
  }
303
  }
304
  });
@@ -371,7 +373,7 @@
371
  plugin.switchToDesktop();
372
  }
373
 
374
- plugin.calculateDynamicSubmenuWidths($("li.mega-menu-megamenu.mega-toggle-on > a.mega-menu-link", $menu));
375
  };
376
 
377
  plugin.reverseRightAlignedItems = function() {
@@ -406,47 +408,76 @@
406
  display: ''
407
  });
408
 
409
- $menu.siblings(".mega-menu-toggle").removeClass('mega-menu-open');
410
  };
411
 
412
- plugin.init = function() {
413
- $menu.triggerHandler("before_mega_menu_init");
414
- plugin.settings = $.extend({}, defaults, options);
415
- $menu.removeClass("mega-no-js");
416
-
417
  // mobile menu
418
- $menu.siblings(".mega-menu-toggle").on("click", function(e) {
 
 
 
 
 
 
 
 
 
419
 
420
- var toggle_bar = $(this);
 
 
 
421
 
422
- if ( $(e.target).is(".mega-menu-toggle-block, .mega-toggle-blocks-left, .mega-toggle-blocks-center, .mega-toggle-blocks-right, .mega-toggle-label, .mega-toggle-label span") ) {
423
 
424
- if ($(plugin.settings.mobile_force_width).length) {
425
- var submenu_offset = toggle_bar.offset();
426
- var target_offset = $(plugin.settings.mobile_force_width).offset();
 
 
 
 
 
 
427
 
428
- $menu.css({
429
- width: $(plugin.settings.mobile_force_width).outerWidth(),
430
- left: (target_offset.left - submenu_offset.left) + "px"
431
- });
432
- }
433
 
434
- if (plugin.settings.effect_mobile == 'slide') {
435
- if ($(this).hasClass("mega-menu-open")) {
436
- $menu.animate({'height':'hide'}, plugin.settings.effect_speed_mobile, function() {
437
- $menu.css({
438
- width: '',
439
- left: '',
440
- display: ''
441
- });
442
- });
443
- } else {
444
- $menu.animate({'height':'show'}, plugin.settings.effect_speed_mobile);
445
- }
446
- }
447
- $(this).toggleClass("mega-menu-open");
448
- }
449
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
450
 
451
  if (plugin.settings.unbind_events == 'true') {
452
  plugin.unbindAllEvents();
@@ -458,6 +489,10 @@
458
  plugin.hidePanel($(this).parent(), false);
459
  });
460
 
 
 
 
 
461
  plugin.bindMegaMenuEvents();
462
  plugin.monitorView();
463
  $menu.triggerHandler("after_mega_menu_init");
8
  $.maxmegamenu = function(menu, options) {
9
  var plugin = this;
10
  var $menu = $(menu);
11
+ var $toggle_bar = $menu.siblings(".mega-menu-toggle");
12
 
13
  var defaults = {
14
  event: $menu.attr("data-event"),
132
 
133
  plugin.calculateDynamicSubmenuWidths = function(anchor) {
134
  // apply dynamic width and sub menu position (only to top level mega menus)
135
+ if (anchor.parent().hasClass("mega-menu-megamenu") && anchor.parent().parent().hasClass("max-mega-menu") && plugin.settings.panel_width && $(plugin.settings.panel_width).length > 0) {
136
  if (plugin.isDesktopView()) {
137
  var submenu_offset = $menu.offset();
138
  var target_offset = $(plugin.settings.panel_width).offset();
150
  }
151
 
152
  // apply inner width to sub menu by adding padding to the left and right of the mega menu
153
+ if (anchor.parent().hasClass("mega-menu-megamenu") && anchor.parent().parent().hasClass("max-mega-menu") && plugin.settings.panel_inner_width && $(plugin.settings.panel_inner_width).length > 0) {
154
  var target_width = 0;
155
 
156
  if ($(plugin.settings.panel_inner_width).length) {
188
  $(document).on("click touchend", function(e) { // hide menu when clicked away from
189
  if (!dragging && plugin.settings.document_click === "collapse" && ! $(e.target).closest(".max-mega-menu li").length && ! $(e.target).closest(".mega-menu-toggle").length ) {
190
  plugin.hideAllPanels();
191
+ plugin.hideMobileMenu();
192
  }
193
  dragging = false;
194
  });
195
 
196
+ $("> a.mega-menu-link", items_with_submenus).on("touchend.megamenu", function(e) {
197
+ plugin.unbindHoverEvents();
198
+ plugin.unbindHoverIntentEvents();
199
+ });
200
+
201
+ $("> a.mega-menu-link", items_with_submenus).on("click.megamenu", function(e) {
202
  if (plugin.isDesktopView() && $(this).parent().hasClass("mega-toggle-on") && $(this).parent().parent().parent().hasClass("mega-menu-tabbed") ) {
203
  if (plugin.settings.second_click === "go") {
204
  return;
281
  plugin.hideAllPanels();
282
 
283
  if ( plugin.isMobileView() ) {
284
+ plugin.hideMobileMenu();
285
  }
286
  }
287
  });
300
  }
301
 
302
  if ( active_link.hasClass("mega-menu-toggle") ) {
303
+ plugin.showMobileMenu();
304
  }
305
  }
306
  });
373
  plugin.switchToDesktop();
374
  }
375
 
376
+ plugin.calculateDynamicSubmenuWidths($("li.mega-menu-megamenu > a.mega-menu-link", $menu));
377
  };
378
 
379
  plugin.reverseRightAlignedItems = function() {
408
  display: ''
409
  });
410
 
411
+ $toggle_bar.removeClass('mega-menu-open');
412
  };
413
 
414
+ plugin.initToggleBar = function() {
 
 
 
 
415
  // mobile menu
416
+ $toggle_bar.on("click", function(e) {
417
+ if ( $(e.target).is(".mega-menu-toggle, .mega-menu-toggle-block, .mega-menu-toggle-animated-block, .mega-menu-toggle-animated-block *, .mega-toggle-blocks-left, .mega-toggle-blocks-center, .mega-toggle-blocks-right, .mega-toggle-label, .mega-toggle-label span") ) {
418
+ if ($(this).hasClass("mega-menu-open")) {
419
+ plugin.hideMobileMenu();
420
+ } else {
421
+ plugin.showMobileMenu();
422
+ }
423
+ }
424
+ });
425
+ };
426
 
427
+ plugin.hideMobileMenu = function() {
428
+ if (plugin.isDesktopView() || ! $toggle_bar.is(":visible")) {
429
+ return;
430
+ }
431
 
432
+ $('body').removeClass($menu.attr('id') + "-mobile-open");
433
 
434
+ if (plugin.settings.effect_mobile == 'slide') {
435
+ $menu.animate({'height':'hide'}, plugin.settings.effect_speed_mobile, function() {
436
+ $menu.css({
437
+ width: '',
438
+ left: '',
439
+ display: ''
440
+ });
441
+ });
442
+ }
443
 
444
+ $toggle_bar.removeClass("mega-menu-open");
445
+ };
 
 
 
446
 
447
+ plugin.showMobileMenu = function() {
448
+ if (plugin.isDesktopView() || ! $toggle_bar.is(":visible")) {
449
+ return;
450
+ }
451
+
452
+ $('body').addClass($menu.attr('id') + "-mobile-open");
453
+
454
+ plugin.toggleBarForceWidth();
455
+
456
+ if (plugin.settings.effect_mobile == 'slide') {
457
+ $menu.animate({'height':'show'}, plugin.settings.effect_speed_mobile);
458
+ }
459
+
460
+ $toggle_bar.addClass("mega-menu-open");
461
+ };
462
+
463
+ plugin.toggleBarForceWidth = function() {
464
+ if ($(plugin.settings.mobile_force_width).length) {
465
+ var submenu_offset = $toggle_bar.offset();
466
+ var target_offset = $(plugin.settings.mobile_force_width).offset();
467
+
468
+ $menu.css({
469
+ width: $(plugin.settings.mobile_force_width).outerWidth(),
470
+ left: (target_offset.left - submenu_offset.left) + "px"
471
+ });
472
+ }
473
+ };
474
+
475
+ plugin.init = function() {
476
+ $menu.triggerHandler("before_mega_menu_init");
477
+ plugin.settings = $.extend({}, defaults, options);
478
+ $menu.removeClass("mega-no-js");
479
+
480
+ plugin.initToggleBar();
481
 
482
  if (plugin.settings.unbind_events == 'true') {
483
  plugin.unbindAllEvents();
489
  plugin.hidePanel($(this).parent(), false);
490
  });
491
 
492
+ $(window).load(function() {
493
+ plugin.calculateDynamicSubmenuWidths($("li.mega-menu-megamenu > a.mega-menu-link", $menu));
494
+ });
495
+
496
  plugin.bindMegaMenuEvents();
497
  plugin.monitorView();
498
  $menu.triggerHandler("after_mega_menu_init");
megamenu.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Max Mega Menu
5
  * Plugin URI: https://www.megamenu.com
6
  * Description: An easy to use mega menu plugin. Written the WordPress way.
7
- * Version: 2.5.2
8
  * Author: megamenu.com
9
  * Author URI: https://www.megamenu.com
10
  * License: GPL-2.0+
@@ -26,7 +26,7 @@ final class Mega_Menu {
26
  /**
27
  * @var string
28
  */
29
- public $version = '2.5.2';
30
 
31
 
32
  /**
@@ -367,6 +367,7 @@ final class Mega_Menu {
367
  }
368
  break;
369
  }
 
370
  }
371
 
372
 
4
  * Plugin Name: Max Mega Menu
5
  * Plugin URI: https://www.megamenu.com
6
  * Description: An easy to use mega menu plugin. Written the WordPress way.
7
+ * Version: 2.5.3
8
  * Author: megamenu.com
9
  * Author URI: https://www.megamenu.com
10
  * License: GPL-2.0+
26
  /**
27
  * @var string
28
  */
29
+ public $version = '2.5.3';
30
 
31
 
32
  /**
367
  }
368
  break;
369
  }
370
+
371
  }
372
 
373
 
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: megamenu
3
  Tags: menu, megamenu, mega menu, navigation, widget, dropdown menu, drag and drop, mobile, responsive, retina, theme editor, widget, shortcode, sidebar, icons, dashicons
4
  Requires at least: 3.8
5
- Tested up to: 4.9
6
- Stable tag: 2.5.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -109,6 +109,20 @@ See https://www.megamenu.com for more screenshots
109
 
110
  == Changelog ==
111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  = 2.5.2 =
113
 
114
  * Fix: Revert "When WPML is installed, do not override the wp_nav_menu_args "menu" parameter to allow WPML to display the correct menu (removing the requirement to enable the WPML "Adjust IDs for multilingual functionality" option)"
2
  Contributors: megamenu
3
  Tags: menu, megamenu, mega menu, navigation, widget, dropdown menu, drag and drop, mobile, responsive, retina, theme editor, widget, shortcode, sidebar, icons, dashicons
4
  Requires at least: 3.8
5
+ Tested up to: 5.0
6
+ Stable tag: 2.5.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
109
 
110
  == Changelog ==
111
 
112
+ = 2.5.3 =
113
+
114
+ * New: Animated Menu Toggle Block
115
+ * Fix: Unable to change the number of columns on a newly added menu items within the "Mega Menu - Standard Layout" sub menu builder
116
+ * Fix: Hide on mobile/desktop options for items within Mega Menu - Grid Layout sub menus
117
+ * Fix: Residual Styling for :before :after pseudo elements
118
+ * Fix: Conflict with uikit.js
119
+ * Fix: Calculate dynamic submenu widths on page load (thanks to floq-design for the suggested fix!)
120
+ * Fix: Remove hover styling from top level menu items on mobile (as Safari continues to apply the hover styling even once the item is deselected).
121
+ [How to apply hover styling for your mobile menu](https://www.megamenu.com/documentation/how-to-apply-hover-styling-to-top-level-items-on-mobile/)
122
+ * Fix: Close mobile menu when page background is clicked
123
+ * Fix: Compatibility with Elementor Pro sticky header
124
+ * Fix: Residual styling on span.mega-indicator
125
+
126
  = 2.5.2 =
127
 
128
  * Fix: Revert "When WPML is installed, do not override the wp_nav_menu_args "menu" parameter to allow WPML to display the correct menu (removing the requirement to enable the WPML "Adjust IDs for multilingual functionality" option)"