Max Mega Menu - Version 2.2

Version Description

  • New feature: CSS3 dropdown animations
  • New feature: Animation speed setting
  • New Feature: Accessibility (allow tab navigation of menus)
  • Improvement: Load widgets.php scripts on nav-menus.php page to improve widget compatibility
  • Improvement: Remove upgrade nags from icons tab
  • Improvement: Add search to icons
  • Improvement: Preselect last edited theme in theme editor
  • Improvement: Only allow widget titles to be dragged in menu builder
  • Improvement: Add 'Mobile menu background' and 'Disable mobile toggle' settings to theme editor
  • Fix: Move toggle block IDs to classes to avoid validation errors
  • Fix: Replace deprecated jQuery 'live' function calls with 'on'
  • Fix: select2.png 404 in admin
  • Fix: Reinstate icon margin on sub menu items when parent item has 'Hide text' enabled
  • Fix: Active menu item border color
  • Fix: Third level menu item visibility when JS is disabled
  • Fix: Compatibility with Conditional Menus
  • Fix: Compatibility with WordFence
  • Fix: Compatibility with Image Widget Deluxe
  • Fix: Widget titles wrapping onto two lines in mega menu builder
  • Fix: Admin elements disappearing randomly in webkit browsers
  • Change: Reset Widget Styling theme option - default changed from 'On' to 'Off'
Download this release

Release Info

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

Code changes from version 2.1.5 to 2.2

classes/menu-item-manager.class.php CHANGED
@@ -406,34 +406,19 @@ class Mega_Menu_Menu_Item_Manager {
406
  'title' => __("Dashicons", "megamenu"),
407
  'active' => ! isset( $menu_item_meta['icon'] ) || ( isset( $menu_item_meta['icon'] ) && substr( $menu_item_meta['icon'], 0, strlen("dash") ) === "dash" || $menu_item_meta['icon'] == 'disabled' ),
408
  'content' => $this->dashicon_selector()
409
- ),
410
- 'fontawesome' => array(
411
- 'title' => __("Font Awesome", "megamenu"),
412
- 'active' => false,
413
- 'content' => str_replace( "{link}", "<a href='https://www.maxmegamenu.com/upgrade/?utm_source=free&amp;utm_medium=link&amp;utm_campaign=pro'>" . __("Max Mega Menu Pro", "megamenu") . "</a>", __("Get access to over 400 Font Awesome Icons with {link}", "megamenu") )
414
- ),
415
- 'genericons' => array(
416
- 'title' => __("Genericons", "megamenu"),
417
- 'active' => false,
418
- 'content' => str_replace( "{link}", "<a href='https://www.maxmegamenu.com/upgrade/?utm_source=free&amp;utm_medium=link&amp;utm_campaign=pro'>" . __("Max Mega Menu Pro", "megamenu") . "</a>", __("Choose from over 100 genericons with {link}", "megamenu") )
419
- ),
420
- 'custom' => array(
421
- 'title' => __("Custom Icon", "megamenu"),
422
- 'active' => false,
423
- 'content' => str_replace( "{link}", "<a href='https://www.maxmegamenu.com/upgrade/?utm_source=free&amp;utm_medium=link&amp;utm_campaign=pro'>" . __("Max Mega Menu Pro", "megamenu") . "</a>", __("Select icons from your media library with {link}", "megamenu") )
424
- ),
425
  );
426
 
427
  $icon_tabs = apply_filters( "megamenu_icon_tabs", $icon_tabs, $menu_item_id, $menu_id, $menu_item_depth, $menu_item_meta );
428
 
429
- $return = ' <h4 class="first">' . __("Menu Item Icon", "megamenu") . '</h4>';
430
  $return .= "<ul class='mm_tabs horizontal'>";
431
 
432
  foreach ( $icon_tabs as $id => $icon_tab ) {
433
 
434
  $active = $icon_tab['active'] || count( $icon_tabs ) === 1 ? "active" : "";
435
 
436
- $return .= "<li rel='mm_tab_{$id}' class='{$active}'>";
437
  $return .= esc_html( $icon_tab['title'] );
438
  $return .= "</li>";
439
 
@@ -441,6 +426,8 @@ class Mega_Menu_Menu_Item_Manager {
441
 
442
  $return .= "</ul>";
443
 
 
 
444
  foreach ($icon_tabs as $id => $icon_tab) {
445
 
446
  $display = $icon_tab['active'] ? "block" : "none";
406
  'title' => __("Dashicons", "megamenu"),
407
  'active' => ! isset( $menu_item_meta['icon'] ) || ( isset( $menu_item_meta['icon'] ) && substr( $menu_item_meta['icon'], 0, strlen("dash") ) === "dash" || $menu_item_meta['icon'] == 'disabled' ),
408
  'content' => $this->dashicon_selector()
409
+ )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
410
  );
411
 
412
  $icon_tabs = apply_filters( "megamenu_icon_tabs", $icon_tabs, $menu_item_id, $menu_id, $menu_item_depth, $menu_item_meta );
413
 
414
+ $return = "<h4 class='first'>" . __("Menu Item Icon", "megamenu") . "</h4>";
415
  $return .= "<ul class='mm_tabs horizontal'>";
416
 
417
  foreach ( $icon_tabs as $id => $icon_tab ) {
418
 
419
  $active = $icon_tab['active'] || count( $icon_tabs ) === 1 ? "active" : "";
420
 
421
+ $return .= "<li rel='mm_tab_{$id}' class='mm_tab_horizontal {$active}'>";
422
  $return .= esc_html( $icon_tab['title'] );
423
  $return .= "</li>";
424
 
426
 
427
  $return .= "</ul>";
428
 
429
+ $return .= "<input type='text' class='filter_icons' placeholder='" . __("Search", "megamenu") . "' /><div class='clear'></div>";
430
+
431
  foreach ($icon_tabs as $id => $icon_tab) {
432
 
433
  $display = $icon_tab['active'] ? "block" : "none";
classes/nav-menus.class.php CHANGED
@@ -139,12 +139,6 @@ class Mega_Menu_Nav_Menus {
139
  if( 'nav-menus.php' != $hook )
140
  return;
141
 
142
- // http://wordpress.org/plugins/image-widget/
143
- if ( class_exists( 'Tribe_Image_Widget' ) ) {
144
- $image_widget = new Tribe_Image_Widget;
145
- $image_widget->admin_setup();
146
- }
147
-
148
  // Compatibility fix for SlideDeck Pro
149
  wp_deregister_script('codemirror');
150
  wp_deregister_style('codemirror');
@@ -157,6 +151,14 @@ class Mega_Menu_Nav_Menus {
157
  wp_deregister_script('colorbox-js');
158
  wp_deregister_style('colorbox-css');
159
 
 
 
 
 
 
 
 
 
160
  wp_enqueue_style( 'colorbox', MEGAMENU_BASE_URL . 'js/colorbox/colorbox.css', false, MEGAMENU_VERSION );
161
  wp_enqueue_style( 'mega-menu', MEGAMENU_BASE_URL . 'css/admin/menus.css', false, MEGAMENU_VERSION );
162
 
@@ -359,9 +361,9 @@ class Mega_Menu_Nav_Menus {
359
  <select name='megamenu_meta[<?php echo $location ?>][effect]'>
360
  <?php
361
 
362
- $selected = isset( $settings[$location]['effect'] ) ? $settings[$location]['effect'] : 'disabled';
363
 
364
- $options = apply_filters("megamenu_effects", array(
365
  "disabled" => array(
366
  'label' => __("None", "megamenu"),
367
  'selected' => $selected == 'disabled',
@@ -370,9 +372,17 @@ class Mega_Menu_Nav_Menus {
370
  'label' => __("Fade", "megamenu"),
371
  'selected' => $selected == 'fade',
372
  ),
 
 
 
 
373
  "slide" => array(
374
  'label' => __("Slide", "megamenu"),
375
  'selected' => $selected == 'slide',
 
 
 
 
376
  )
377
  ), $selected );
378
 
@@ -382,6 +392,26 @@ class Mega_Menu_Nav_Menus {
382
 
383
  ?>
384
  </select>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
385
  </td>
386
  </tr>
387
  <tr>
139
  if( 'nav-menus.php' != $hook )
140
  return;
141
 
 
 
 
 
 
 
142
  // Compatibility fix for SlideDeck Pro
143
  wp_deregister_script('codemirror');
144
  wp_deregister_style('codemirror');
151
  wp_deregister_script('colorbox-js');
152
  wp_deregister_style('colorbox-css');
153
 
154
+ // Compatibility fix for purple-xmls-google-product-feed-for-woocommerce
155
+ wp_deregister_script('cart-product-colorbox');
156
+ wp_deregister_style('cart-product-colorstyle');
157
+
158
+ // Compatibility fix for WordFence
159
+ wp_deregister_script('jquery.wfcolorbox');
160
+ wp_deregister_style('wordfence-colorbox-style');
161
+
162
  wp_enqueue_style( 'colorbox', MEGAMENU_BASE_URL . 'js/colorbox/colorbox.css', false, MEGAMENU_VERSION );
163
  wp_enqueue_style( 'mega-menu', MEGAMENU_BASE_URL . 'css/admin/menus.css', false, MEGAMENU_VERSION );
164
 
361
  <select name='megamenu_meta[<?php echo $location ?>][effect]'>
362
  <?php
363
 
364
+ $selected = isset( $settings[$location]['effect'] ) ? $settings[$location]['effect'] : 'fade_up';
365
 
366
+ $options = apply_filters("megamenu_transition_effects", array(
367
  "disabled" => array(
368
  'label' => __("None", "megamenu"),
369
  'selected' => $selected == 'disabled',
372
  'label' => __("Fade", "megamenu"),
373
  'selected' => $selected == 'fade',
374
  ),
375
+ "fade_up" => array(
376
+ 'label' => __("Fade Up", "megamenu"),
377
+ 'selected' => $selected == 'fade_up' || $selected == 'fadeUp',
378
+ ),
379
  "slide" => array(
380
  'label' => __("Slide", "megamenu"),
381
  'selected' => $selected == 'slide',
382
+ ),
383
+ "slide_up" => array(
384
+ 'label' => __("Slide Up", "megamenu"),
385
+ 'selected' => $selected == 'slide_up',
386
  )
387
  ), $selected );
388
 
392
 
393
  ?>
394
  </select>
395
+
396
+ <select name='megamenu_meta[<?php echo $location ?>][effect_speed]'>
397
+ <?php
398
+
399
+ $selected = isset( $settings[$location]['effect_speed'] ) ? $settings[$location]['effect_speed'] : '200';
400
+
401
+ $options = apply_filters("megamenu_effect_speed", array(
402
+ "600" => __("Slow", "megamenu"),
403
+ "400" => __("Med", "megamenu"),
404
+ "200" => __("Fast", "megamenu")
405
+ ), $selected );
406
+
407
+ ksort($options);
408
+
409
+ foreach ( $options as $key => $value ) {
410
+ ?><option value='<?php echo $key ?>' <?php selected( $key == $selected ); ?>><?php echo $value ?></option><?php
411
+ }
412
+
413
+ ?>
414
+ </select>
415
  </td>
416
  </tr>
417
  <tr>
classes/settings.class.php CHANGED
@@ -54,6 +54,7 @@ class Mega_Menu_Settings {
54
  add_action( 'megamenu_page_theme_editor', array( $this, 'theme_editor_page'));
55
  add_action( 'megamenu_page_tools', array( $this, 'tools_page'));
56
  add_action( 'megamenu_page_general_settings', array( $this, 'general_settings_page'));
 
57
 
58
  add_action( 'admin_menu', array( $this, 'megamenu_themes_page') );
59
  add_action( 'megamenu_admin_scripts', array( $this, 'enqueue_scripts' ) );
@@ -69,9 +70,13 @@ class Mega_Menu_Settings {
69
  if ( class_exists( "Mega_Menu_Style_Manager" ) ) {
70
 
71
  $style_manager = new Mega_Menu_Style_Manager();
72
-
73
  $this->themes = $style_manager->get_themes();
74
- $this->id = isset( $_GET['theme'] ) ? $_GET['theme'] : 'default';
 
 
 
 
 
75
  $this->active_theme = $this->themes[$this->id];
76
 
77
  }
@@ -122,6 +127,7 @@ class Mega_Menu_Settings {
122
  $saved_themes[ $theme ] = array_map( 'esc_attr', $submitted_settings );
123
 
124
  update_site_option( "megamenu_themes", $saved_themes );
 
125
 
126
  do_action("megamenu_after_theme_save");
127
 
@@ -153,7 +159,7 @@ class Mega_Menu_Settings {
153
 
154
  do_action("megamenu_after_add_menu_location");
155
 
156
- $this->redirect( admin_url( 'admin.php?page=maxmegamenu&add_location=true' ) );
157
 
158
  }
159
 
@@ -180,7 +186,7 @@ class Mega_Menu_Settings {
180
 
181
  do_action("megamenu_delete_cache");
182
 
183
- $this->redirect( admin_url( 'admin.php?page=maxmegamenu&delete_location=true' ) );
184
 
185
  }
186
 
@@ -585,6 +591,7 @@ class Mega_Menu_Settings {
585
  $tabs = apply_filters("megamenu_menu_tabs", array(
586
  'general_settings' => __("General Settings", "megamenu"),
587
  'theme_editor' => __("Menu Themes", "megamenu"),
 
588
  'tools' => __("Tools", "megamenu")
589
  ));
590
 
@@ -606,27 +613,6 @@ class Mega_Menu_Settings {
606
  */
607
  public function general_settings_page( $saved_settings ) {
608
 
609
- $all_locations = get_registered_nav_menus();
610
- $locations = array();
611
-
612
- if ( count( $all_locations ) ) {
613
-
614
- $megamenu_locations = array();
615
-
616
- // reorder locations so custom MMM locations are listed at the bottom
617
- foreach ( $all_locations as $location => $val ) {
618
-
619
- if ( strpos( $location, 'max_mega_menu_' ) === FALSE ) {
620
- $locations[$location] = $val;
621
- } else {
622
- $megamenu_locations[$location] = $val;
623
- }
624
-
625
- }
626
-
627
- $locations = array_merge( $locations, $megamenu_locations );
628
- }
629
-
630
  $css = isset( $saved_settings['css'] ) ? $saved_settings['css'] : 'fs';
631
  $mobile_second_click = isset( $saved_settings['second_click'] ) ? $saved_settings['second_click'] : 'close';
632
  $mobile_behaviour = isset( $saved_settings['mobile_behaviour'] ) ? $saved_settings['mobile_behaviour'] : 'standard';
@@ -696,6 +682,56 @@ class Mega_Menu_Settings {
696
  </tr>
697
  </table>
698
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
699
  <h3 class='first'><?php _e("Menu Locations", "megamenu"); ?></h3>
700
 
701
  <table>
@@ -719,14 +755,6 @@ class Mega_Menu_Settings {
719
  echo str_replace( "{number}", count( $locations ), $some );
720
  }
721
 
722
- $add_location_url = esc_url( add_query_arg(
723
- array(
724
- 'action'=>'megamenu_add_menu_location'
725
- ),
726
- wp_nonce_url( admin_url("admin-post.php"), 'megamenu_add_menu_location' )
727
- ) );
728
- echo " <a href='{$add_location_url}'>" . __("Add another menu location.") . "</a>";
729
-
730
  ?>
731
  </p>
732
 
@@ -843,8 +871,17 @@ class Mega_Menu_Settings {
843
  }
844
 
845
  echo "</div>";
 
 
846
  echo "</div>";
847
 
 
 
 
 
 
 
 
848
  }?>
849
 
850
  </td>
@@ -852,14 +889,7 @@ class Mega_Menu_Settings {
852
  </table>
853
 
854
 
855
-
856
- <?php do_action( "megamenu_general_settings", $saved_settings ); ?>
857
-
858
- <?php
859
-
860
- submit_button();
861
-
862
- ?>
863
  </form>
864
  </div>
865
 
@@ -922,7 +952,7 @@ class Mega_Menu_Settings {
922
  <tr>
923
  <td class='mega-name'>
924
  <?php _e("Cache", "megamenu"); ?>
925
- <div class='mega-description'><?php _e("Use this tool to clear the CSS cache.", "megamenu"); ?></div>
926
  </td>
927
  <td class='mega-value'>
928
  <form action="<?php echo admin_url('admin-post.php'); ?>" method="post">
@@ -1015,7 +1045,7 @@ class Mega_Menu_Settings {
1015
  echo "</select>";
1016
 
1017
  echo "<h4>" . __("Export Format", "megamenu") . "</h4>";
1018
- echo "<input value='json' type='radio' name='format'>" . __("JSON - I want to import this theme into another site I'm developing") . "<br />";
1019
  echo "<input value='php' type='radio' name='format'>" . __("PHP - I want to distribute this Menu Theme in a WordPress Theme I'm developing") . "<br />";
1020
 
1021
  echo "<input type='submit' name='export' class='button button-secondary' value='" . __("Export Theme", "megamenu") . "' />";
@@ -1162,6 +1192,7 @@ class Mega_Menu_Settings {
1162
  $tabs = apply_filters("megamenu_menu_tabs", array(
1163
  'general_settings' => __("General Settings", "megamenu"),
1164
  'theme_editor' => __("Menu Themes", "megamenu"),
 
1165
  'tools' => __("Tools", "megamenu")
1166
  ));
1167
 
@@ -2814,19 +2845,6 @@ class Mega_Menu_Settings {
2814
  'mobile_menu' => array(
2815
  'title' => __( "Mobile Menu", "megamenu" ),
2816
  'settings' => array(
2817
- 'responsive_breakpoint' => array(
2818
- 'priority' => 10,
2819
- 'title' => __( "Responsive Breakpoint", "megamenu" ),
2820
- 'description' => __( "Set the width at which the menu turns into a mobile menu. Set to 0px to disable responsive menu.", "megamenu" ),
2821
- 'settings' => array(
2822
- array(
2823
- 'title' => __( "", "megamenu" ),
2824
- 'type' => 'freetext',
2825
- 'key' => 'responsive_breakpoint',
2826
- 'validation' => 'px'
2827
- )
2828
- ),
2829
- ),
2830
  /**'responsive_text' => array(
2831
  'title' => __( "Toggle Bar Text", "megamenu" ),
2832
  'description' => __( "Text to display next to the mobile toggle icon.", "megamenu" ),
@@ -2878,6 +2896,31 @@ class Mega_Menu_Settings {
2878
  )
2879
  )
2880
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2881
  'mobile_columns' => array(
2882
  'priority' => 30,
2883
  'title' => __( "Mega Menu Columns", "megamenu" ),
@@ -2890,6 +2933,23 @@ class Mega_Menu_Settings {
2890
  )
2891
  )
2892
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2893
  'mobile_menu_item_height' => array(
2894
  'priority' => 40,
2895
  'title' => __( "Menu Item Height", "megamenu" ),
@@ -3313,8 +3373,14 @@ class Mega_Menu_Settings {
3313
  <ul class='custom_styling_tips'>
3314
  <li><code>#{$wrap}</code> <?php _e("converts to the ID selector of the menu wrapper, e.g. div#mega-menu-wrap-primary", "megamenu"); ?></li>
3315
  <li><code>#{$menu}</code> <?php _e("converts to the ID selector of the menu, e.g. ul#mega-menu-primary", "megamenu"); ?></li>
3316
- <li><?php _e("Use @import rules to import CSS from other plugins or your theme directory, e.g:"); ?>
3317
- <br /><br /><code>#{$wrap} #{$menu} {<br />&nbsp;&nbsp;&nbsp;&nbsp;@import "shortcodes-ultimate/assets/css/box-shortcodes.css";<br />}</code></li>
 
 
 
 
 
 
3318
  </ul>
3319
 
3320
  <?php
54
  add_action( 'megamenu_page_theme_editor', array( $this, 'theme_editor_page'));
55
  add_action( 'megamenu_page_tools', array( $this, 'tools_page'));
56
  add_action( 'megamenu_page_general_settings', array( $this, 'general_settings_page'));
57
+ add_action( 'megamenu_page_menu_locations', array( $this, 'menu_locations_page'));
58
 
59
  add_action( 'admin_menu', array( $this, 'megamenu_themes_page') );
60
  add_action( 'megamenu_admin_scripts', array( $this, 'enqueue_scripts' ) );
70
  if ( class_exists( "Mega_Menu_Style_Manager" ) ) {
71
 
72
  $style_manager = new Mega_Menu_Style_Manager();
 
73
  $this->themes = $style_manager->get_themes();
74
+
75
+ $last_updated = get_option('megamenu_themes_last_updated');
76
+
77
+ $preselected_theme = isset( $this->themes[ $last_updated ] ) ? $last_updated : 'default';
78
+
79
+ $this->id = isset( $_GET['theme'] ) ? $_GET['theme'] : $preselected_theme;
80
  $this->active_theme = $this->themes[$this->id];
81
 
82
  }
127
  $saved_themes[ $theme ] = array_map( 'esc_attr', $submitted_settings );
128
 
129
  update_site_option( "megamenu_themes", $saved_themes );
130
+ update_site_option( "megamenu_themes_last_updated", $theme );
131
 
132
  do_action("megamenu_after_theme_save");
133
 
159
 
160
  do_action("megamenu_after_add_menu_location");
161
 
162
+ $this->redirect( admin_url( 'admin.php?page=maxmegamenu_menu_locations&add_location=true' ) );
163
 
164
  }
165
 
186
 
187
  do_action("megamenu_delete_cache");
188
 
189
+ $this->redirect( admin_url( 'admin.php?page=maxmegamenu_menu_locations&delete_location=true' ) );
190
 
191
  }
192
 
591
  $tabs = apply_filters("megamenu_menu_tabs", array(
592
  'general_settings' => __("General Settings", "megamenu"),
593
  'theme_editor' => __("Menu Themes", "megamenu"),
594
+ 'menu_locations' => __("Menu Locations", "megamenu"),
595
  'tools' => __("Tools", "megamenu")
596
  ));
597
 
613
  */
614
  public function general_settings_page( $saved_settings ) {
615
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
616
  $css = isset( $saved_settings['css'] ) ? $saved_settings['css'] : 'fs';
617
  $mobile_second_click = isset( $saved_settings['second_click'] ) ? $saved_settings['second_click'] : 'close';
618
  $mobile_behaviour = isset( $saved_settings['mobile_behaviour'] ) ? $saved_settings['mobile_behaviour'] : 'standard';
682
  </tr>
683
  </table>
684
 
685
+ <?php do_action( "megamenu_general_settings", $saved_settings ); ?>
686
+
687
+ <?php
688
+
689
+ submit_button();
690
+
691
+ ?>
692
+ </form>
693
+ </div>
694
+
695
+ <?php
696
+ }
697
+
698
+
699
+ /**
700
+ * Content for 'Settings' tab
701
+ *
702
+ * @since 1.4
703
+ */
704
+ public function menu_locations_page( $saved_settings ) {
705
+
706
+ $all_locations = get_registered_nav_menus();
707
+ $locations = array();
708
+
709
+ if ( count( $all_locations ) ) {
710
+
711
+ $megamenu_locations = array();
712
+
713
+ // reorder locations so custom MMM locations are listed at the bottom
714
+ foreach ( $all_locations as $location => $val ) {
715
+
716
+ if ( strpos( $location, 'max_mega_menu_' ) === FALSE ) {
717
+ $locations[$location] = $val;
718
+ } else {
719
+ $megamenu_locations[$location] = $val;
720
+ }
721
+
722
+ }
723
+
724
+ $locations = array_merge( $locations, $megamenu_locations );
725
+ }
726
+
727
+ ?>
728
+
729
+ <div class='menu_settings'>
730
+
731
+ <form action="<?php echo admin_url('admin-post.php'); ?>" method="post">
732
+ <input type="hidden" name="action" value="megamenu_save_settings" />
733
+ <?php wp_nonce_field( 'megamenu_save_settings' ); ?>
734
+
735
  <h3 class='first'><?php _e("Menu Locations", "megamenu"); ?></h3>
736
 
737
  <table>
755
  echo str_replace( "{number}", count( $locations ), $some );
756
  }
757
 
 
 
 
 
 
 
 
 
758
  ?>
759
  </p>
760
 
871
  }
872
 
873
  echo "</div>";
874
+
875
+
876
  echo "</div>";
877
 
878
+ $add_location_url = esc_url( add_query_arg(
879
+ array(
880
+ 'action'=>'megamenu_add_menu_location'
881
+ ),
882
+ wp_nonce_url( admin_url("admin-post.php"), 'megamenu_add_menu_location' )
883
+ ) );
884
+ echo "<br /><p><a class='button button-secondary' href='{$add_location_url}'>" . __("Add another menu location") . "</a></p>";
885
  }?>
886
 
887
  </td>
889
  </table>
890
 
891
 
892
+ <?php do_action( "megamenu_menu_locations", $saved_settings ); ?>
 
 
 
 
 
 
 
893
  </form>
894
  </div>
895
 
952
  <tr>
953
  <td class='mega-name'>
954
  <?php _e("Cache", "megamenu"); ?>
955
+ <div class='mega-description'><?php _e("The CSS cache is automatically cleared every time a menu or a menu theme is saved. You can manually clear the CSS cache using this tool.", "megamenu"); ?></div>
956
  </td>
957
  <td class='mega-value'>
958
  <form action="<?php echo admin_url('admin-post.php'); ?>" method="post">
1045
  echo "</select>";
1046
 
1047
  echo "<h4>" . __("Export Format", "megamenu") . "</h4>";
1048
+ echo "<input value='json' type='radio' checked='checked' name='format'>" . __("JSON - I want to import this theme into another site I'm developing") . "<br />";
1049
  echo "<input value='php' type='radio' name='format'>" . __("PHP - I want to distribute this Menu Theme in a WordPress Theme I'm developing") . "<br />";
1050
 
1051
  echo "<input type='submit' name='export' class='button button-secondary' value='" . __("Export Theme", "megamenu") . "' />";
1192
  $tabs = apply_filters("megamenu_menu_tabs", array(
1193
  'general_settings' => __("General Settings", "megamenu"),
1194
  'theme_editor' => __("Menu Themes", "megamenu"),
1195
+ 'menu_locations' => __("Menu Locations", "megamenu"),
1196
  'tools' => __("Tools", "megamenu")
1197
  ));
1198
 
2845
  'mobile_menu' => array(
2846
  'title' => __( "Mobile Menu", "megamenu" ),
2847
  'settings' => array(
 
 
 
 
 
 
 
 
 
 
 
 
 
2848
  /**'responsive_text' => array(
2849
  'title' => __( "Toggle Bar Text", "megamenu" ),
2850
  'description' => __( "Text to display next to the mobile toggle icon.", "megamenu" ),
2896
  )
2897
  )
2898
  ),
2899
+ 'disable_mobile_toggle' => array(
2900
+ 'priority' => 25,
2901
+ 'title' => __( "Disable Mobile Toggle", "megamenu" ),
2902
+ 'description' => __( "Hide the toggle bar and display the menu in it's open state by default.", "megamenu" ),
2903
+ 'settings' => array(
2904
+ array(
2905
+ 'title' => __( "", "megamenu" ),
2906
+ 'type' => 'checkbox',
2907
+ 'key' => 'disable_mobile_toggle'
2908
+ )
2909
+ )
2910
+ ),
2911
+ 'responsive_breakpoint' => array(
2912
+ 'priority' => 17,
2913
+ 'title' => __( "Responsive Breakpoint", "megamenu" ),
2914
+ 'description' => __( "Set the width at which the menu turns into a mobile menu. Set to 0px to disable responsive menu.", "megamenu" ),
2915
+ 'settings' => array(
2916
+ array(
2917
+ 'title' => __( "", "megamenu" ),
2918
+ 'type' => 'freetext',
2919
+ 'key' => 'responsive_breakpoint',
2920
+ 'validation' => 'px'
2921
+ )
2922
+ ),
2923
+ ),
2924
  'mobile_columns' => array(
2925
  'priority' => 30,
2926
  'title' => __( "Mega Menu Columns", "megamenu" ),
2933
  )
2934
  )
2935
  ),
2936
+ 'mobile_background' => array(
2937
+ 'priority' => 35,
2938
+ 'title' => __( "Menu Background", "megamenu" ),
2939
+ 'description' => __( "Set the background color for the mobile menu.", "megamenu" ),
2940
+ 'settings' => array(
2941
+ array(
2942
+ 'title' => __( "From", "megamenu" ),
2943
+ 'type' => 'color',
2944
+ 'key' => 'mobile_background_from'
2945
+ ),
2946
+ array(
2947
+ 'title' => __( "To", "megamenu" ),
2948
+ 'type' => 'color',
2949
+ 'key' => 'mobile_background_to'
2950
+ )
2951
+ )
2952
+ ),
2953
  'mobile_menu_item_height' => array(
2954
  'priority' => 40,
2955
  'title' => __( "Menu Item Height", "megamenu" ),
3373
  <ul class='custom_styling_tips'>
3374
  <li><code>#{$wrap}</code> <?php _e("converts to the ID selector of the menu wrapper, e.g. div#mega-menu-wrap-primary", "megamenu"); ?></li>
3375
  <li><code>#{$menu}</code> <?php _e("converts to the ID selector of the menu, e.g. ul#mega-menu-primary", "megamenu"); ?></li>
3376
+ <?php
3377
+ $string = __("Using the %wrap% and %menu% variables makes your theme portable (allowing you to apply the same theme to multiple menu locations).", "megamenu");
3378
+ $string = str_replace('%wrap%', '<code>#{$wrap}</code>', $string);
3379
+ $string = str_replace('%menu%', '<code>#{$menu}</code>', $string);
3380
+ ?>
3381
+ <li><?php echo $string; ?></li>
3382
+ <li>Example CSS:</li>
3383
+ <code>/** Add text shadow to top level menu items **/<br>#{$wrap} #{$menu} > li.mega-menu-item > a.mega-menu-link {<br />&nbsp;&nbsp;&nbsp;&nbsp;text-shadow: 1px 1px #000000;<br />}</code></li>
3384
  </ul>
3385
 
3386
  <?php
classes/style-manager.class.php CHANGED
@@ -54,7 +54,6 @@ final class Mega_Menu_Style_Manager {
54
  add_action( 'megamenu_after_delete_cache', array( $this, 'wpml_delete_cache') );
55
  }
56
 
57
-
58
  }
59
 
60
 
@@ -82,8 +81,8 @@ final class Mega_Menu_Style_Manager {
82
  'font_color' => '#666', // deprecated
83
  'font_family' => 'inherit', // deprecated
84
  'menu_item_align' => 'left',
85
- 'menu_item_background_from' => 'transparent',
86
- 'menu_item_background_to' => 'transparent',
87
  'menu_item_background_hover_from' => '#333',
88
  'menu_item_background_hover_to' => '#333',
89
  'menu_item_spacing' => '0px',
@@ -92,7 +91,7 @@ final class Mega_Menu_Style_Manager {
92
  'menu_item_link_height' => '40px',
93
  'menu_item_link_color' => '#ffffff',
94
  'menu_item_link_weight' => 'normal',
95
- 'menu_item_link_text_transform' => 'normal',
96
  'menu_item_link_text_decoration' => 'none',
97
  'menu_item_link_color_hover' => '#ffffff',
98
  'menu_item_link_weight_hover' => 'normal',
@@ -167,8 +166,8 @@ final class Mega_Menu_Style_Manager {
167
  'panel_second_level_font_weight_hover' => 'panel_header_font_weight',
168
  'panel_second_level_text_decoration' => 'panel_header_text_decoration',
169
  'panel_second_level_text_decoration_hover' => 'panel_header_text_decoration',
170
- 'panel_second_level_background_hover_from' => 'transparent',
171
- 'panel_second_level_background_hover_to' => 'transparent',
172
  'panel_second_level_padding_left' => '0px',
173
  'panel_second_level_padding_right' => '0px',
174
  'panel_second_level_padding_top' => '0px',
@@ -191,8 +190,8 @@ final class Mega_Menu_Style_Manager {
191
  'panel_third_level_font_weight_hover' => 'normal',
192
  'panel_third_level_text_decoration' => 'none',
193
  'panel_third_level_text_decoration_hover' => 'none',
194
- 'panel_third_level_background_hover_from' => 'transparent',
195
- 'panel_third_level_background_hover_to' => 'transparent',
196
  'panel_third_level_padding_left' => '0px',
197
  'panel_third_level_padding_right' => '0px',
198
  'panel_third_level_padding_top' => '0px',
@@ -232,7 +231,7 @@ final class Mega_Menu_Style_Manager {
232
  'flyout_link_color' => 'font_color',
233
  'flyout_link_color_hover' => 'font_color',
234
  'flyout_link_family' => 'font_family',
235
- 'flyout_link_text_transform' => 'normal',
236
  'responsive_breakpoint' => '600px',
237
  'responsive_text' => 'MENU', // deprecated
238
  'line_height' => '1.7',
@@ -244,17 +243,18 @@ final class Mega_Menu_Style_Manager {
244
  'shadow_spread' => '0px',
245
  'shadow_color' => 'rgba(0, 0, 0, 0.1)',
246
  'transitions' => 'off',
247
- 'resets' => 'on',
248
  'mobile_columns' => '2',
249
  'toggle_background_from' => 'container_background_from',
250
  'toggle_background_to' => 'container_background_to',
251
  'toggle_font_color' => 'menu_item_link_color', // deprecated
252
  'toggle_bar_height' => '40px',
253
  'mobile_menu_item_height' => '40px',
 
 
 
254
  'custom_css' => '
255
- #{$wrap} #{$menu} {
256
- /** Custom styles should be added below this line **/
257
- }
258
  #{$wrap} {
259
  clear: both;
260
  }'
@@ -262,6 +262,7 @@ final class Mega_Menu_Style_Manager {
262
  }
263
 
264
 
 
265
  /**
266
  *
267
  * @since 1.0
@@ -509,6 +510,19 @@ final class Mega_Menu_Style_Manager {
509
  */
510
  private function load_scss_file() {
511
 
 
 
 
 
 
 
 
 
 
 
 
 
 
512
  $scss = file_get_contents( MEGAMENU_PATH . trailingslashit('css') . 'mixin.scss' );
513
  $scss .= file_get_contents( MEGAMENU_PATH . trailingslashit('css') . 'reset.scss' );
514
 
@@ -523,7 +537,11 @@ final class Mega_Menu_Style_Manager {
523
  if ( file_exists( $path ) ) {
524
 
525
  $scss .= file_get_contents( $path );
526
-
 
 
 
 
527
  }
528
 
529
  }
@@ -590,8 +608,19 @@ final class Mega_Menu_Style_Manager {
590
  $vars['menu'] = "'$menu_selector'";
591
  $vars['menu_id'] = "'$menu_id'";
592
 
 
 
 
 
 
 
 
 
 
 
593
  foreach( $theme as $name => $value ) {
594
 
 
595
  if ( in_array( $name, array( 'arrow_up', 'arrow_down', 'arrow_left', 'arrow_right' ) ) ) {
596
 
597
  $parts = explode( '-', $value );
@@ -740,8 +769,7 @@ final class Mega_Menu_Style_Manager {
740
  ),
741
  "out" => array(
742
  "animate" => array("opacity" => "hide")
743
- ),
744
- "speed" => "fast"
745
  ),
746
  "slide" => array(
747
  "in" => array(
@@ -750,8 +778,7 @@ final class Mega_Menu_Style_Manager {
750
  ),
751
  "out" => array(
752
  "animate" => array("height" => "hide")
753
- ),
754
- "speed" => "fast"
755
  )
756
  ),
757
  "timeout" => 300,
@@ -763,6 +790,20 @@ final class Mega_Menu_Style_Manager {
763
 
764
  }
765
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
766
 
767
  /**
768
  * Enqueue the stylesheet held on the filesystem.
54
  add_action( 'megamenu_after_delete_cache', array( $this, 'wpml_delete_cache') );
55
  }
56
 
 
57
  }
58
 
59
 
81
  'font_color' => '#666', // deprecated
82
  'font_family' => 'inherit', // deprecated
83
  'menu_item_align' => 'left',
84
+ 'menu_item_background_from' => 'rgba(0,0,0,0)',
85
+ 'menu_item_background_to' => 'rgba(0,0,0,0)',
86
  'menu_item_background_hover_from' => '#333',
87
  'menu_item_background_hover_to' => '#333',
88
  'menu_item_spacing' => '0px',
91
  'menu_item_link_height' => '40px',
92
  'menu_item_link_color' => '#ffffff',
93
  'menu_item_link_weight' => 'normal',
94
+ 'menu_item_link_text_transform' => 'none',
95
  'menu_item_link_text_decoration' => 'none',
96
  'menu_item_link_color_hover' => '#ffffff',
97
  'menu_item_link_weight_hover' => 'normal',
166
  'panel_second_level_font_weight_hover' => 'panel_header_font_weight',
167
  'panel_second_level_text_decoration' => 'panel_header_text_decoration',
168
  'panel_second_level_text_decoration_hover' => 'panel_header_text_decoration',
169
+ 'panel_second_level_background_hover_from' => 'rgba(0,0,0,0)',
170
+ 'panel_second_level_background_hover_to' => 'rgba(0,0,0,0)',
171
  'panel_second_level_padding_left' => '0px',
172
  'panel_second_level_padding_right' => '0px',
173
  'panel_second_level_padding_top' => '0px',
190
  'panel_third_level_font_weight_hover' => 'normal',
191
  'panel_third_level_text_decoration' => 'none',
192
  'panel_third_level_text_decoration_hover' => 'none',
193
+ 'panel_third_level_background_hover_from' => 'rgba(0,0,0,0)',
194
+ 'panel_third_level_background_hover_to' => 'rgba(0,0,0,0)',
195
  'panel_third_level_padding_left' => '0px',
196
  'panel_third_level_padding_right' => '0px',
197
  'panel_third_level_padding_top' => '0px',
231
  'flyout_link_color' => 'font_color',
232
  'flyout_link_color_hover' => 'font_color',
233
  'flyout_link_family' => 'font_family',
234
+ 'flyout_link_text_transform' => 'none',
235
  'responsive_breakpoint' => '600px',
236
  'responsive_text' => 'MENU', // deprecated
237
  'line_height' => '1.7',
243
  'shadow_spread' => '0px',
244
  'shadow_color' => 'rgba(0, 0, 0, 0.1)',
245
  'transitions' => 'off',
246
+ 'resets' => 'off',
247
  'mobile_columns' => '2',
248
  'toggle_background_from' => 'container_background_from',
249
  'toggle_background_to' => 'container_background_to',
250
  'toggle_font_color' => 'menu_item_link_color', // deprecated
251
  'toggle_bar_height' => '40px',
252
  'mobile_menu_item_height' => '40px',
253
+ 'mobile_background_from' => 'container_background_from',
254
+ 'mobile_background_to' => 'container_background_to',
255
+ 'disable_mobile_toggle' => 'off',
256
  'custom_css' => '
257
+ /** Push menu onto new line **/
 
 
258
  #{$wrap} {
259
  clear: both;
260
  }'
262
  }
263
 
264
 
265
+
266
  /**
267
  *
268
  * @since 1.0
510
  */
511
  private function load_scss_file() {
512
 
513
+ /**
514
+ * *** IMPORTANT NOTICE ***
515
+ *
516
+ * Allowing users to create their own versions of megamenu.scss was a poor design decision.
517
+ *
518
+ * The bundled SCSS file and the plugin code work in perfect harmony.
519
+ *
520
+ * When a user (or theme developer) creates their own copy of megamenu.scss it
521
+ * _will_ become outdated as the plugin is updated and the menu HTML changes.
522
+ *
523
+ * Instead of using a custom SCSS file, override only the absolutel minimum CSS in the
524
+ * Menu Theme > Custom Styling section.
525
+ */
526
  $scss = file_get_contents( MEGAMENU_PATH . trailingslashit('css') . 'mixin.scss' );
527
  $scss .= file_get_contents( MEGAMENU_PATH . trailingslashit('css') . 'reset.scss' );
528
 
537
  if ( file_exists( $path ) ) {
538
 
539
  $scss .= file_get_contents( $path );
540
+ //break;
541
+ //
542
+ // @todo: add a break here. This is a known bug but some users may be relying on it.
543
+ // Add warning message to plugin to alert users about not using custom megamenu.scss files
544
+ // then fix the bug in a later release.
545
  }
546
 
547
  }
608
  $vars['menu'] = "'$menu_selector'";
609
  $vars['menu_id'] = "'$menu_id'";
610
 
611
+ $settings = $this->get_menu_settings_for_location( $location );
612
+
613
+ if ( isset( $settings['effect_speed'] ) && intval( $settings['effect_speed'] ) > 0 ) {
614
+ $effect_speed = intval( $settings['effect_speed'] ) . 'ms';
615
+ } else {
616
+ $effect_speed = '200ms';
617
+ }
618
+
619
+ $vars['effect_speed'] = $effect_speed;
620
+
621
  foreach( $theme as $name => $value ) {
622
 
623
+
624
  if ( in_array( $name, array( 'arrow_up', 'arrow_down', 'arrow_left', 'arrow_right' ) ) ) {
625
 
626
  $parts = explode( '-', $value );
769
  ),
770
  "out" => array(
771
  "animate" => array("opacity" => "hide")
772
+ )
 
773
  ),
774
  "slide" => array(
775
  "in" => array(
778
  ),
779
  "out" => array(
780
  "animate" => array("height" => "hide")
781
+ )
 
782
  )
783
  ),
784
  "timeout" => 300,
790
 
791
  }
792
 
793
+ /**
794
+ * Returns the menu settings for a specified location.
795
+ *
796
+ * @since 2.2
797
+ */
798
+ private function get_menu_settings_for_location( $location ) {
799
+
800
+ $settings = $this->settings;
801
+
802
+ $location_settings = isset( $settings[ $location ] ) ? $settings[ $location ] : array();
803
+
804
+ return $location_settings;
805
+
806
+ }
807
 
808
  /**
809
  * Enqueue the stylesheet held on the filesystem.
classes/toggle-blocks.class.php CHANGED
@@ -126,7 +126,23 @@ class Mega_Menu_Toggle_Blocks {
126
  $align = "mega-toggle-block-left";
127
  }
128
 
129
- $blocks_html .= "<div class='mega-toggle-block {$class} {$align}' id='mega-toggle-block-{$block_id}'>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  $blocks_html .= apply_filters("megamenu_output_public_toggle_block_{$block['type']}", "", $block);
131
  $blocks_html .= "</div>";
132
  }
126
  $align = "mega-toggle-block-left";
127
  }
128
 
129
+ // @todo remove ID once MMM Pro has been updated to use classes
130
+ $id = apply_filters('megamenu_toggle_block_id', 'mega-toggle-block-' . $block_id);
131
+
132
+ $attributes = apply_filters('megamenu_toggle_block_attributes', array(
133
+ "class" => "mega-toggle-block {$class} {$align} mega-toggle-block-{$block_id}",
134
+ "id" => "mega-toggle-block-{$block_id}"
135
+ ), $block, $content, $nav_menu, $args, $theme_id);
136
+
137
+
138
+
139
+ $blocks_html .= "<div";
140
+
141
+ foreach ( $attributes as $attribute => $val ) {
142
+ $blocks_html .= " " . $attribute . "='" . esc_attr( $val ) . "'";
143
+ }
144
+
145
+ $blocks_html .= " />";
146
  $blocks_html .= apply_filters("megamenu_output_public_toggle_block_{$block['type']}", "", $block);
147
  $blocks_html .= "</div>";
148
  }
classes/walker.class.php CHANGED
@@ -99,6 +99,7 @@ class Mega_Menu_Walker extends Walker_Nav_Menu {
99
  $atts['class'] = '';
100
  $atts['rel'] = ! empty( $item->xfn ) ? $item->xfn : '';
101
 
 
102
  if ( $settings['disable_link'] != 'true') {
103
  $atts['href'] = ! empty( $item->url ) ? $item->url : '';
104
  }
@@ -115,11 +116,15 @@ class Mega_Menu_Walker extends Walker_Nav_Menu {
115
  $atts['class'] = 'mega-menu-link';
116
  }
117
 
 
 
 
 
118
  $attributes = '';
119
 
120
  foreach ( $atts as $attr => $value ) {
121
 
122
- if ( ! empty( $value ) ) {
123
  $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );
124
  $attributes .= ' ' . $attr . '="' . $value . '"';
125
  }
99
  $atts['class'] = '';
100
  $atts['rel'] = ! empty( $item->xfn ) ? $item->xfn : '';
101
 
102
+
103
  if ( $settings['disable_link'] != 'true') {
104
  $atts['href'] = ! empty( $item->url ) ? $item->url : '';
105
  }
116
  $atts['class'] = 'mega-menu-link';
117
  }
118
 
119
+ if ( $depth == 0 ) {
120
+ $atts['tabindex'] = "0";
121
+ }
122
+
123
  $attributes = '';
124
 
125
  foreach ( $atts as $attr => $value ) {
126
 
127
+ if ( strlen( $value ) ) {
128
  $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );
129
  $attributes .= ' ' . $attr . '="' . $value . '"';
130
  }
css/admin/menus.css CHANGED
@@ -6,7 +6,6 @@
6
  user-select: none;
7
  }
8
 
9
-
10
  #cboxClose {
11
  text-indent: 0;
12
  background: none;
@@ -25,7 +24,7 @@
25
  color: #0074a2;
26
  }
27
 
28
- #cboxContent .mm_tabs.horizontal li {
29
  float: left;
30
  margin-right: 10px;
31
  cursor: pointer;
@@ -35,17 +34,23 @@
35
  transition: all 0.05s linear;
36
  }
37
 
38
- #cboxContent .mm_tabs.horizontal li:hover,
39
- #cboxContent .mm_tabs.horizontal li.active {
40
  background: #2ea2cc;
41
  color: white;
42
  }
43
 
44
  #cboxContent .mm_tabs.horizontal {
45
- width: 100%;
46
  float: left;
47
  margin-top: 0;
48
  }
 
 
 
 
 
 
49
 
50
  #cboxContent .mm_header_container {
51
  float: left;
@@ -118,7 +123,8 @@
118
  width: 80%;
119
  overflow: auto;
120
  box-sizing: border-box;
121
-
 
122
  }
123
 
124
  #cboxContent .mega_menu #widgets .no_widgets {
@@ -223,6 +229,7 @@
223
  border: 1px solid #999;
224
  padding: 0 10px;
225
  background: white;
 
226
  }
227
 
228
  #cboxContent .mega_menu .widget.open .widget-top {
@@ -243,16 +250,11 @@
243
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
244
  margin-top: -1px;
245
  background: white;
246
- min-width: 240px;
247
- border: 1px solid #999;
248
  box-sizing: border-box;
249
  }
250
 
251
-
252
- #cboxContent .mega_menu .widget-title {
253
- display: inline-block;
254
- }
255
-
256
  #cboxContent .mega_menu .widget-title h4 {
257
  float: left;
258
  margin: 0;
@@ -260,9 +262,9 @@
260
  overflow: hidden;
261
  white-space: nowrap;
262
  border-bottom: 0;
263
- font-size: 1em;
264
  text-overflow: ellipsis;
265
- line-height: 40px;
266
  }
267
 
268
  #cboxContent .mega_menu .widget[data-type='menu_item'] .widget-title h4:before {
@@ -331,14 +333,15 @@
331
 
332
  #cboxContent .mega_menu .widget-title-action {
333
  padding: 0;
334
- float: right;
335
  position: relative;
336
- opacity: 0.6;
337
  font-weight: normal;
338
- }
339
-
340
- #cboxContent .mega_menu .widget:hover .widget-title-action {
 
 
341
  opacity: 1;
 
342
  }
343
 
344
  #cboxContent .mega_menu .widget-title-action a {
@@ -547,87 +550,15 @@
547
  max-width: 700px;
548
  }
549
 
550
- #cboxContent .mega_menu #widgets[data-columns='2'] .widget[data-columns='1'] h4 {
551
- max-width: 280px;
552
- }
553
-
554
- #cboxContent .mega_menu #widgets[data-columns='3'] .widget[data-columns='1'] h4 {
555
- max-width: 165px;
556
- }
557
- #cboxContent .mega_menu #widgets[data-columns='3'] .widget[data-columns='2'] h4 {
558
- max-width: 430px;
559
- }
560
-
561
- #cboxContent .mega_menu #widgets[data-columns='4'] .widget[data-columns='1'] h4 {
562
- max-width: 105px;
563
- }
564
- #cboxContent .mega_menu #widgets[data-columns='4'] .widget[data-columns='2'] h4 {
565
- max-width: 280px;
566
- }
567
- #cboxContent .mega_menu #widgets[data-columns='4'] .widget[data-columns='3'] h4 {
568
- max-width: 500px;
569
- }
570
-
571
- #cboxContent .mega_menu #widgets[data-columns='5'] .widget[data-columns='1'] h4 {
572
- max-width: 65px;
573
- }
574
- #cboxContent .mega_menu #widgets[data-columns='5'] .widget[data-columns='2'] h4 {
575
- max-width: 220px;
576
- }
577
- #cboxContent .mega_menu #widgets[data-columns='5'] .widget[data-columns='3'] h4 {
578
- max-width: 380px;
579
- }
580
-
581
- #cboxContent .mega_menu #widgets[data-columns='6'] .widget[data-columns='1'] h4 {
582
- max-width: 40px;
583
- }
584
- #cboxContent .mega_menu #widgets[data-columns='6'] .widget[data-columns='2'] h4 {
585
- max-width: 170px;
586
- }
587
- #cboxContent .mega_menu #widgets[data-columns='6'] .widget[data-columns='3'] h4 {
588
- max-width: 300px;
589
- }
590
- #cboxContent .mega_menu #widgets[data-columns='6'] .widget[data-columns='4'] h4 {
591
- max-width: 430px;
592
- }
593
-
594
- #cboxContent .mega_menu #widgets[data-columns='7'] .widget[data-columns='1'] h4 {
595
- max-width: 24px;
596
- }
597
- #cboxContent .mega_menu #widgets[data-columns='7'] .widget[data-columns='2'] h4 {
598
- max-width: 130px;
599
- }
600
- #cboxContent .mega_menu #widgets[data-columns='7'] .widget[data-columns='3'] h4 {
601
- max-width: 240px;
602
- }
603
- #cboxContent .mega_menu #widgets[data-columns='7'] .widget[data-columns='4'] h4 {
604
- max-width: 350px;
605
- }
606
- #cboxContent .mega_menu #widgets[data-columns='7'] .widget[data-columns='5'] h4 {
607
- max-width: 480px;
608
- }
609
-
610
- #cboxContent .mega_menu #widgets[data-columns='8'] .widget[data-columns='1'] h4 {
611
- max-width: 8px;
612
- }
613
- #cboxContent .mega_menu #widgets[data-columns='8'] .widget[data-columns='2'] h4 {
614
- max-width: 100px;
615
- }
616
- #cboxContent .mega_menu #widgets[data-columns='8'] .widget[data-columns='3'] h4 {
617
- max-width: 200px;
618
- }
619
- #cboxContent .mega_menu #widgets[data-columns='8'] .widget[data-columns='4'] h4 {
620
- max-width: 300px;
621
- }
622
- #cboxContent .mega_menu #widgets[data-columns='8'] .widget[data-columns='5'] h4 {
623
- max-width: 400px;
624
- }
625
 
626
 
627
  #cboxContent .mega_menu .widget textarea {
628
  max-height: 100px;
629
  }
630
 
 
 
 
631
  #cboxContent .menu_icon .icon_selector > div {
632
  float: left;
633
  padding: 0 19px 19px 0;
@@ -711,8 +642,13 @@
711
  #cboxContent table td.mega-value {
712
  font-size: 12px;
713
  }
714
- #cboxContent table td.mega-value select {
 
 
 
715
  font-size: 0.9em;
 
 
716
  }
717
  #cboxContent table td.mega-name .mega-description,
718
  #cboxContent table td.mega-value .mega-description {
@@ -758,34 +694,16 @@
758
  opacity: 0.3;
759
 
760
  }
761
-
762
-
763
- /**
764
- * NAV MENUS
765
- */
766
  /** TRIBE IMAGE WIDGET **/
767
- .uploader input.button {
768
- width: 100%;
769
- height: 34px;
770
- line-height: 33px;
771
- margin-top: 15px;
772
- }
773
- .tribe_preview .aligncenter {
774
- display: block;
775
- margin-left: auto !important;
776
- margin-right: auto !important;
777
- }
778
- .tribe_preview {
779
- overflow: hidden;
780
- max-height: 300px;
781
- }
782
- .tribe_preview img {
783
- margin: 10px 0;
784
  height: auto;
785
  max-width: 100%;
786
  }
787
- /** END TRIBE IMAGE WIDGET **/
788
 
 
 
 
 
789
  .megamenu_enabled .mm_launch {
790
  background: #2ea2cc;
791
  border-color: #0074a2;
6
  user-select: none;
7
  }
8
 
 
9
  #cboxClose {
10
  text-indent: 0;
11
  background: none;
24
  color: #0074a2;
25
  }
26
 
27
+ #cboxContent .mm_tabs li.mm_tab_horizontal {
28
  float: left;
29
  margin-right: 10px;
30
  cursor: pointer;
34
  transition: all 0.05s linear;
35
  }
36
 
37
+ #cboxContent .mm_tabs li.mm_tab_horizontal:hover,
38
+ #cboxContent .mm_tabs li.mm_tab_horizontal.active {
39
  background: #2ea2cc;
40
  color: white;
41
  }
42
 
43
  #cboxContent .mm_tabs.horizontal {
44
+ width: 85%;
45
  float: left;
46
  margin-top: 0;
47
  }
48
+ #cboxContent .filter_icons {
49
+ width: 14%;
50
+ float: right;
51
+ margin-top: 0;
52
+ font-size: 0.9em;
53
+ }
54
 
55
  #cboxContent .mm_header_container {
56
  float: left;
123
  width: 80%;
124
  overflow: auto;
125
  box-sizing: border-box;
126
+ /* fix content disappearing */
127
+ -webkit-transform: translate3d(0, 0, 0);
128
  }
129
 
130
  #cboxContent .mega_menu #widgets .no_widgets {
229
  border: 1px solid #999;
230
  padding: 0 10px;
231
  background: white;
232
+ overflow: hidden;
233
  }
234
 
235
  #cboxContent .mega_menu .widget.open .widget-top {
250
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
251
  margin-top: -1px;
252
  background: white;
253
+ min-width: 340px;
254
+ border: 1px solid #555;
255
  box-sizing: border-box;
256
  }
257
 
 
 
 
 
 
258
  #cboxContent .mega_menu .widget-title h4 {
259
  float: left;
260
  margin: 0;
262
  overflow: hidden;
263
  white-space: nowrap;
264
  border-bottom: 0;
265
+ font-size: 12px;
266
  text-overflow: ellipsis;
267
+ line-height: 42px;
268
  }
269
 
270
  #cboxContent .mega_menu .widget[data-type='menu_item'] .widget-title h4:before {
333
 
334
  #cboxContent .mega_menu .widget-title-action {
335
  padding: 0;
 
336
  position: relative;
 
337
  font-weight: normal;
338
+ position: absolute;
339
+ right: 1px;
340
+ background: white;
341
+ border-right: 7px solid white;
342
+ padding-left: 10px;
343
  opacity: 1;
344
+ background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 9%, rgba(255,255,255,1) 100%);
345
  }
346
 
347
  #cboxContent .mega_menu .widget-title-action a {
550
  max-width: 700px;
551
  }
552
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
553
 
554
 
555
  #cboxContent .mega_menu .widget textarea {
556
  max-height: 100px;
557
  }
558
 
559
+ #cboxContent .menu_icon .icon_selector {
560
+ clear: both;
561
+ }
562
  #cboxContent .menu_icon .icon_selector > div {
563
  float: left;
564
  padding: 0 19px 19px 0;
642
  #cboxContent table td.mega-value {
643
  font-size: 12px;
644
  }
645
+ #cboxContent table td.mega-value select,
646
+ #cboxContent table td.mega-value textarea,
647
+ #cboxContent table td.mega-value input[type=text],
648
+ #cboxContent table td.mega-value input[type=number] {
649
  font-size: 0.9em;
650
+ height: 28px;
651
+ line-height: 28px;
652
  }
653
  #cboxContent table td.mega-name .mega-description,
654
  #cboxContent table td.mega-value .mega-description {
694
  opacity: 0.3;
695
 
696
  }
 
 
 
 
 
697
  /** TRIBE IMAGE WIDGET **/
698
+ #cboxContent img {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
699
  height: auto;
700
  max-width: 100%;
701
  }
 
702
 
703
+
704
+ /**
705
+ * NAV MENUS
706
+ */
707
  .megamenu_enabled .mm_launch {
708
  background: #2ea2cc;
709
  border-color: #0074a2;
css/admin/settings.css CHANGED
@@ -74,7 +74,8 @@
74
  margin-top: 0;
75
  }
76
  .mega-menu_page_maxmegamenu_tools .menu_settings h3,
77
- .toplevel_page_maxmegamenu .menu_settings h3 {
 
78
  border-bottom: 1px solid #CAC4C4;
79
  padding: 0 0 10px 0;
80
  }
@@ -233,6 +234,7 @@
233
 
234
  .megamenu_outer_wrap .megamenu_right .menu_settings table textarea,
235
  .megamenu_outer_wrap .megamenu_right .menu_settings table input[type=text],
 
236
  .megamenu_outer_wrap .megamenu_right .menu_settings table select {
237
  font-size: 0.9em;
238
  height: 28px;
74
  margin-top: 0;
75
  }
76
  .mega-menu_page_maxmegamenu_tools .menu_settings h3,
77
+ .toplevel_page_maxmegamenu .menu_settings h3,
78
+ .mega-menu_page_maxmegamenu_menu_locations .menu_settings h3 {
79
  border-bottom: 1px solid #CAC4C4;
80
  padding: 0 0 10px 0;
81
  }
234
 
235
  .megamenu_outer_wrap .megamenu_right .menu_settings table textarea,
236
  .megamenu_outer_wrap .megamenu_right .menu_settings table input[type=text],
237
+ .megamenu_outer_wrap .megamenu_right .menu_settings table input[type=number],
238
  .megamenu_outer_wrap .megamenu_right .menu_settings table select {
239
  font-size: 0.9em;
240
  height: 28px;
css/megamenu.scss CHANGED
@@ -1,12 +1,14 @@
1
- // ---------------- DO NOT EDIT THIS FILE DIRECTLY ---------------
2
- // Copy this file to the wp-content/themes/YOUR_THEME/megamenu/megamenu.scss
3
  //
4
- // Important Note: Re-save your menu in WordPress after copying this
5
- // file in order to regenerate the cached CSS.
 
 
6
  //
7
- // Developer Tips
8
- // -- Set "define("MEGAMENU_DEBUG", true);" in wp-config.php to disable CSS cache
9
- // -- Add &nocache to the CSS URL to regenerate cache
10
 
11
  #{$wrap},
12
  #{$wrap} #{$menu},
@@ -64,6 +66,12 @@
64
  text-align: $menu_item_align;
65
  padding: $container_padding_top $container_padding_right $container_padding_bottom $container_padding_left;
66
 
 
 
 
 
 
 
67
  @include mobile {
68
  padding: 0;
69
  }
@@ -79,6 +87,12 @@
79
  }
80
  }
81
 
 
 
 
 
 
 
82
  p {
83
  margin-bottom: 10px;
84
  }
@@ -94,6 +108,69 @@
94
  opacity: 1;
95
  }
96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  &.mega-no-js li.mega-menu-item:hover > ul.mega-sub-menu,
98
  &.mega-no-js li.mega-menu-item:focus > ul.mega-sub-menu,
99
  li.mega-menu-item.mega-toggle-on > ul.mega-sub-menu,
@@ -101,6 +178,10 @@
101
  visibility: visible;
102
  }
103
 
 
 
 
 
104
  li.mega-menu-item a[class^='dashicons']:before {
105
  font-family: dashicons;
106
  }
@@ -125,6 +206,10 @@
125
  margin: 0;
126
  }
127
 
 
 
 
 
128
  li.mega-align-bottom-left {
129
  > ul.mega-sub-menu {
130
 
@@ -160,16 +245,12 @@
160
 
161
  @if $menu_item_divider == 'on' {
162
  border-left: 1px solid $menu_item_divider_color;
163
- -webkit-box-shadow: inset 1px 0 0 0 rgba(255,255,255,$menu_item_divider_glow_opacity);
164
- -moz-box-shadow: inset 1px 0 0 0 rgba(255,255,255,$menu_item_divider_glow_opacity);
165
- box-shadow: inset 1px 0 0 0 rgba(255,255,255,$menu_item_divider_glow_opacity);
166
 
167
  /* Hide divider on first menu item */
168
  &:first-of-type {
169
  border-left: 0;
170
- -webkit-box-shadow: none;
171
- -moz-box-shadow: none;
172
- box-shadow: none;
173
  }
174
  }
175
 
@@ -197,6 +278,7 @@
197
  color: $menu_item_link_color_hover;
198
  font-weight: $menu_item_link_weight_hover;
199
  text-decoration: $menu_item_link_text_decoration_hover;
 
200
  }
201
  }
202
 
@@ -445,9 +527,7 @@
445
  /* Hide divider on last menu item */
446
  &:last-child {
447
  border-bottom: 0;
448
- -webkit-box-shadow: none;
449
- -moz-box-shadow: none;
450
- box-shadow: none;
451
  }
452
  }
453
 
@@ -525,7 +605,6 @@
525
  > a.mega-menu-link:after {
526
  content: $arrow_down;
527
  display: inline-block;
528
- font: inherit;
529
  font-family: dashicons;
530
  margin: 0 0 0 6px;
531
  vertical-align: top;
@@ -651,10 +730,13 @@
651
  -khtml-user-select: none;
652
  -moz-user-select: none;
653
  -ms-user-select: none;
654
- user-select: none;
655
 
656
  @include mobile {
657
  display: block;
 
 
 
 
658
  }
659
 
660
  .mega-toggle-block {
@@ -683,6 +765,10 @@
683
  + #{$menu} {
684
  display: none;
685
 
 
 
 
 
686
  li.mega-menu-item > ul.mega-sub-menu {
687
  display: none;
688
  visibility: visible;
1
+ // ------------------------- DO NOT EDIT THIS FILE ----------------------------
2
+ // ****** This file will be overwritten each time the plugin is updated *******
3
  //
4
+ // This file is a major component of Max Mega Menu. The styling below works in
5
+ // perfect harmony with the current version of the menu HTML. The menu HTML
6
+ // will change as features are added to the plugin. Likewise, this CSS will be
7
+ // updated as new features are added to Max Mega Menu.
8
  //
9
+ // If you need to apply custom styling to your menu go to Mega Menu > Menu Themes
10
+ // and enter your custom CSS into the Custom Styling area. Use the same (or more
11
+ // specific) selectors to ensure your custom CSS overrides the default CSS.
12
 
13
  #{$wrap},
14
  #{$wrap} #{$menu},
66
  text-align: $menu_item_align;
67
  padding: $container_padding_top $container_padding_right $container_padding_bottom $container_padding_left;
68
 
69
+ @if $container_background_from != $mobile_background_from or $mobile_container_background_to != $mobile_background_to {
70
+ @include mobile {
71
+ @include background($mobile_background_from, $mobile_background_to);
72
+ }
73
+ }
74
+
75
  @include mobile {
76
  padding: 0;
77
  }
87
  }
88
  }
89
 
90
+ &.mega-keyboard-navigation + .mega-menu-toggle.mega-menu-open,
91
+ &.mega-keyboard-navigation a:focus,
92
+ &.mega-keyboard-navigation input:focus {
93
+ @include box-shadow(inset 0px 0px 3px 1px #00FFFF);
94
+ }
95
+
96
  p {
97
  margin-bottom: 10px;
98
  }
108
  opacity: 1;
109
  }
110
 
111
+ li.mega-menu-item.mega-animating > ul.mega-sub-menu {
112
+ visibility: visible;
113
+ }
114
+
115
+ &[data-effect="fade"] {
116
+
117
+ li.mega-menu-item > ul.mega-sub-menu {
118
+ opacity: 0;
119
+ transition-duration: $effect_speed;
120
+ transition-timing-function: ease-in;
121
+ transition-property: opacity;
122
+ }
123
+
124
+ &.mega-no-js li.mega-menu-item:hover > ul.mega-sub-menu,
125
+ &.mega-no-js li.mega-menu-item:focus > ul.mega-sub-menu,
126
+ li.mega-menu-item.mega-toggle-on > ul.mega-sub-menu,
127
+ li.mega-menu-item.mega-menu-megamenu.mega-toggle-on ul.mega-sub-menu {
128
+ opacity: 1;
129
+ }
130
+
131
+ }
132
+
133
+ &[data-effect="fade_up"] {
134
+
135
+ li.mega-menu-item.mega-menu-megamenu > ul.mega-sub-menu,
136
+ li.mega-menu-item.mega-menu-flyout ul.mega-sub-menu {
137
+ opacity: 0;
138
+ margin-top: 10px;
139
+ transition-duration: $effect_speed;
140
+ transition-timing-function: ease-in;
141
+ transition-property: opacity, margin-top;
142
+ }
143
+
144
+ &.mega-no-js li.mega-menu-item:hover > ul.mega-sub-menu,
145
+ &.mega-no-js li.mega-menu-item:focus > ul.mega-sub-menu,
146
+ li.mega-menu-item.mega-toggle-on > ul.mega-sub-menu,
147
+ li.mega-menu-item.mega-menu-megamenu.mega-toggle-on ul.mega-sub-menu {
148
+ opacity: 1;
149
+ margin-top: 0;
150
+ }
151
+
152
+ }
153
+
154
+ &[data-effect="slide_up"] {
155
+
156
+ li.mega-menu-item.mega-menu-megamenu > ul.mega-sub-menu,
157
+ li.mega-menu-item.mega-menu-flyout ul.mega-sub-menu {
158
+ margin-top: 10px;
159
+ transition-duration: $effect_speed;
160
+ transition-timing-function: ease-in;
161
+ transition-property: margin-top;
162
+ }
163
+
164
+ &.mega-no-js li.mega-menu-item:hover > ul.mega-sub-menu,
165
+ &.mega-no-js li.mega-menu-item:focus > ul.mega-sub-menu,
166
+ li.mega-menu-item.mega-toggle-on > ul.mega-sub-menu,
167
+ li.mega-menu-item.mega-menu-megamenu.mega-toggle-on ul.mega-sub-menu {
168
+ margin-top: 0;
169
+ }
170
+
171
+ }
172
+
173
+
174
  &.mega-no-js li.mega-menu-item:hover > ul.mega-sub-menu,
175
  &.mega-no-js li.mega-menu-item:focus > ul.mega-sub-menu,
176
  li.mega-menu-item.mega-toggle-on > ul.mega-sub-menu,
178
  visibility: visible;
179
  }
180
 
181
+ li.mega-menu-item.mega-menu-megamenu ul.mega-sub-menu ul.mega-sub-menu {
182
+ visibility: inherit;
183
+ }
184
+
185
  li.mega-menu-item a[class^='dashicons']:before {
186
  font-family: dashicons;
187
  }
206
  margin: 0;
207
  }
208
 
209
+ li.mega-menu-item.mega-hide-text li.mega-menu-item a.mega-menu-link:before {
210
+ margin: 0 6px 0 0;
211
+ }
212
+
213
  li.mega-align-bottom-left {
214
  > ul.mega-sub-menu {
215
 
245
 
246
  @if $menu_item_divider == 'on' {
247
  border-left: 1px solid $menu_item_divider_color;
248
+ @include box-shadow(inset 1px 0 0 0 rgba(255,255,255,$menu_item_divider_glow_opacity));
 
 
249
 
250
  /* Hide divider on first menu item */
251
  &:first-of-type {
252
  border-left: 0;
253
+ @include box-shadow(none);
 
 
254
  }
255
  }
256
 
278
  color: $menu_item_link_color_hover;
279
  font-weight: $menu_item_link_weight_hover;
280
  text-decoration: $menu_item_link_text_decoration_hover;
281
+ border-color: $menu_item_border_color_hover;
282
  }
283
  }
284
 
527
  /* Hide divider on last menu item */
528
  &:last-child {
529
  border-bottom: 0;
530
+ @include box-shadow(none);
 
 
531
  }
532
  }
533
 
605
  > a.mega-menu-link:after {
606
  content: $arrow_down;
607
  display: inline-block;
 
608
  font-family: dashicons;
609
  margin: 0 0 0 6px;
610
  vertical-align: top;
730
  -khtml-user-select: none;
731
  -moz-user-select: none;
732
  -ms-user-select: none;
 
733
 
734
  @include mobile {
735
  display: block;
736
+
737
+ @if $disable_mobile_toggle == on {
738
+ display: none;
739
+ }
740
  }
741
 
742
  .mega-toggle-block {
765
  + #{$menu} {
766
  display: none;
767
 
768
+ @if $disable_mobile_toggle == on {
769
+ display: block;
770
+ }
771
+
772
  li.mega-menu-item > ul.mega-sub-menu {
773
  display: none;
774
  visibility: visible;
css/toggle-blocks.scss CHANGED
@@ -14,7 +14,7 @@
14
 
15
  @if type-of($id) == number {
16
 
17
- #mega-toggle-block-#{$id}:before {
18
  content: $closed_icon;
19
  font-family: 'dashicons';
20
  font-size: 24px;
@@ -22,11 +22,11 @@
22
  color: $icon_color;
23
  }
24
 
25
- &.mega-menu-open #mega-toggle-block-#{$id}:before {
26
  content: $open_icon;
27
  }
28
 
29
- #mega-toggle-block-#{$id}:after {
30
  content: $closed_text;
31
  color: $text_color;
32
  float: left;
@@ -36,7 +36,7 @@
36
  }
37
  }
38
 
39
- &.mega-menu-open #mega-toggle-block-#{$id}:after {
40
  content: $open_text;
41
  }
42
  }
@@ -52,7 +52,7 @@
52
 
53
  @if type-of($id) == number {
54
 
55
- #mega-toggle-block-#{$id} {
56
  width: $width;
57
  margin: 0;
58
  }
14
 
15
  @if type-of($id) == number {
16
 
17
+ .mega-toggle-block-#{$id}:before {
18
  content: $closed_icon;
19
  font-family: 'dashicons';
20
  font-size: 24px;
22
  color: $icon_color;
23
  }
24
 
25
+ &.mega-menu-open .mega-toggle-block-#{$id}:before {
26
  content: $open_icon;
27
  }
28
 
29
+ .mega-toggle-block-#{$id}:after {
30
  content: $closed_text;
31
  color: $text_color;
32
  float: left;
36
  }
37
  }
38
 
39
+ &.mega-menu-open .mega-toggle-block-#{$id}:after {
40
  content: $open_text;
41
  }
42
  }
52
 
53
  @if type-of($id) == number {
54
 
55
+ .mega-toggle-block-#{$id} {
56
  width: $width;
57
  margin: 0;
58
  }
js/admin.js CHANGED
@@ -78,41 +78,27 @@
78
 
79
  // bind save button action
80
  content.find('form').on("submit", function (e) {
81
-
82
  start_saving();
83
-
84
  e.preventDefault();
85
-
86
  var data = $(this).serialize();
87
-
88
  $.post(ajaxurl, data, function (submit_response) {
89
-
90
  end_saving();
91
-
92
  panel.log(submit_response);
93
  });
94
 
95
  });
96
 
97
  if (idx == 'menu_icon') {
98
-
99
  var form = content.find('form');
100
 
101
  // bind save button action
102
  form.on("change", function (e) {
103
-
104
  start_saving();
105
-
106
  e.preventDefault();
107
-
108
  $("input", form).not(e.target).removeAttr('checked');
109
-
110
  var data = $(this).serialize();
111
-
112
  $.post(ajaxurl, data, function (submit_response) {
113
-
114
  end_saving();
115
-
116
  panel.log(submit_response);
117
  });
118
 
@@ -144,12 +130,8 @@
144
  _wpnonce: megamenu.nonce
145
  };
146
 
147
-
148
-
149
  $.post(ajaxurl, postdata, function (select_response) {
150
-
151
  end_saving();
152
-
153
  panel.log(select_response);
154
  });
155
 
@@ -173,9 +155,7 @@
173
  };
174
 
175
  $.post(ajaxurl, postdata, function (select_response) {
176
-
177
  end_saving();
178
-
179
  panel.log(select_response);
180
  });
181
 
@@ -212,6 +192,7 @@
212
  forcePlaceholderSize: true,
213
  items : '.widget:not(.sub_menu)',
214
  placeholder: "drop-area",
 
215
  start: function (event, ui) {
216
  $(".widget").removeClass("open");
217
  ui.item.data('start_pos', ui.item.index());
@@ -248,26 +229,16 @@
248
  };
249
 
250
  $.post(ajaxurl, postdata, function (response) {
251
-
252
  $(".no_widgets").hide();
253
-
254
  var widget = $(response.data);
255
-
256
  var number_of_columns = content.find('#mm_number_of_columns').val();
257
-
258
  widget.find(".widget-total-cols").html(number_of_columns);
259
-
260
  add_events_to_widget(widget);
261
-
262
  $("#widgets").append(widget);
263
-
264
  widget_area.trigger("reorder_widgets");
265
-
266
  end_saving();
267
-
268
  // reset the dropdown
269
  selector.val('disabled');
270
-
271
  });
272
 
273
  }
@@ -295,13 +266,41 @@
295
  }
296
 
297
  tabs_container.append(tab);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
  content_container.append(content);
299
  });
300
 
301
  $('#cboxLoadedContent').addClass('depth-' + panel.settings.menu_item_depth).append(header_container).append(tabs_container).append(content_container);
302
  $('#cboxLoadedContent').css({'width': '100%', 'height': '100%', 'display':'block'});
303
  $('#cboxLoadedContent').trigger('megamenu_content_loaded');
304
-
305
  }
306
  });
307
 
@@ -490,6 +489,8 @@
490
  bstw( widget ).deactivate().activate();
491
  }
492
 
 
 
493
  });
494
 
495
  } else {
@@ -516,7 +517,7 @@
516
  jQuery(function ($) {
517
  "use strict";
518
 
519
- $(".megamenu_launch").live("click", function (e) {
520
  e.preventDefault();
521
 
522
  $(this).megaMenu();
@@ -581,16 +582,6 @@ jQuery(function ($) {
581
  $('.item-title', menu_item).append(button);
582
  });
583
 
584
- $(".mm_tabs li").live('click', function() {
585
- var tab = $(this);
586
- var tab_id = $(this).attr('rel');
587
-
588
- tab.addClass('active');
589
- tab.siblings().removeClass('active');
590
- tab.parent().siblings().not('h4').hide();
591
- tab.parent().siblings("." + tab_id).show();
592
- });
593
-
594
  // AJAX Save MMM Settings
595
  $(".max-mega-menu-save").on('click', function(e) {
596
  e.preventDefault();
78
 
79
  // bind save button action
80
  content.find('form').on("submit", function (e) {
 
81
  start_saving();
 
82
  e.preventDefault();
 
83
  var data = $(this).serialize();
 
84
  $.post(ajaxurl, data, function (submit_response) {
 
85
  end_saving();
 
86
  panel.log(submit_response);
87
  });
88
 
89
  });
90
 
91
  if (idx == 'menu_icon') {
 
92
  var form = content.find('form');
93
 
94
  // bind save button action
95
  form.on("change", function (e) {
 
96
  start_saving();
 
97
  e.preventDefault();
 
98
  $("input", form).not(e.target).removeAttr('checked');
 
99
  var data = $(this).serialize();
 
100
  $.post(ajaxurl, data, function (submit_response) {
 
101
  end_saving();
 
102
  panel.log(submit_response);
103
  });
104
 
130
  _wpnonce: megamenu.nonce
131
  };
132
 
 
 
133
  $.post(ajaxurl, postdata, function (select_response) {
 
134
  end_saving();
 
135
  panel.log(select_response);
136
  });
137
 
155
  };
156
 
157
  $.post(ajaxurl, postdata, function (select_response) {
 
158
  end_saving();
 
159
  panel.log(select_response);
160
  });
161
 
192
  forcePlaceholderSize: true,
193
  items : '.widget:not(.sub_menu)',
194
  placeholder: "drop-area",
195
+ handle: ".widget-top",
196
  start: function (event, ui) {
197
  $(".widget").removeClass("open");
198
  ui.item.data('start_pos', ui.item.index());
229
  };
230
 
231
  $.post(ajaxurl, postdata, function (response) {
 
232
  $(".no_widgets").hide();
 
233
  var widget = $(response.data);
 
234
  var number_of_columns = content.find('#mm_number_of_columns').val();
 
235
  widget.find(".widget-total-cols").html(number_of_columns);
 
236
  add_events_to_widget(widget);
 
237
  $("#widgets").append(widget);
 
238
  widget_area.trigger("reorder_widgets");
 
239
  end_saving();
 
240
  // reset the dropdown
241
  selector.val('disabled');
 
242
  });
243
 
244
  }
266
  }
267
 
268
  tabs_container.append(tab);
269
+
270
+ $(".mm_tab_horizontal", content).on('click', function() {
271
+ var tab = $(this);
272
+ var tab_id = $(this).attr('rel');
273
+
274
+ // reset search
275
+ $(".filter_icons").val("");
276
+ $(".icon_selector > div").show();
277
+
278
+ tab.addClass('active');
279
+ tab.siblings().removeClass('active');
280
+ tab.parent().siblings().not('h4').not('input').hide();
281
+ tab.parent().siblings("." + tab_id).show();
282
+ });
283
+
284
+ $(".filter_icons", content).on('keyup', function() {
285
+ var string = $(".filter_icons").val();
286
+
287
+ var all = $(".icon_selector:visible div input");
288
+
289
+ var filtered = all.filter(function() {
290
+ return $(this).attr('id').indexOf(string) > -1;
291
+ });
292
+
293
+ filtered.parent().show();
294
+ var others = all.not(filtered);
295
+ others.parent().hide();
296
+ });
297
+
298
  content_container.append(content);
299
  });
300
 
301
  $('#cboxLoadedContent').addClass('depth-' + panel.settings.menu_item_depth).append(header_container).append(tabs_container).append(content_container);
302
  $('#cboxLoadedContent').css({'width': '100%', 'height': '100%', 'display':'block'});
303
  $('#cboxLoadedContent').trigger('megamenu_content_loaded');
 
304
  }
305
  });
306
 
489
  bstw( widget ).deactivate().activate();
490
  }
491
 
492
+ $( document ).trigger( 'widget-added', widget);
493
+
494
  });
495
 
496
  } else {
517
  jQuery(function ($) {
518
  "use strict";
519
 
520
+ $(".menu").on("click", ".megamenu_launch", function (e) {
521
  e.preventDefault();
522
 
523
  $(this).megaMenu();
582
  $('.item-title', menu_item).append(button);
583
  });
584
 
 
 
 
 
 
 
 
 
 
 
585
  // AJAX Save MMM Settings
586
  $(".max-mega-menu-save").on('click', function(e) {
587
  e.preventDefault();
js/maxmegamenu.js CHANGED
@@ -16,6 +16,7 @@
16
  var defaults = {
17
  event: $menu.attr('data-event'),
18
  effect: $menu.attr('data-effect'),
 
19
  panel_width: $menu.attr('data-panel-width'),
20
  panel_inner_width: $menu.attr('data-panel-inner-width'),
21
  second_click: $menu.attr('data-second-click'),
@@ -36,32 +37,49 @@
36
  anchor.siblings('.mega-sub-menu').children('.mega-toggle-on').removeClass('mega-toggle-on');
37
 
38
  if (immediate) {
39
- anchor.siblings('.mega-sub-menu').removeClass('mega-toggle-on').css('display', '');
40
  anchor.parent().removeClass('mega-toggle-on').triggerHandler("close_panel");
41
  return;
42
  }
43
 
 
 
44
  if ( megamenu.effect[plugin.settings.effect] ) {
45
  var effect = megamenu.effect[plugin.settings.effect]['out'];
46
- var speed = megamenu.effect[plugin.settings.effect]['speed'] ? megamenu.effect[plugin.settings.effect]['speed'] : "fast";
47
 
48
  if (effect.css) {
49
  anchor.siblings('.mega-sub-menu').css(effect.css);
50
  }
51
 
52
  if (effect.animate) {
 
53
  anchor.siblings('.mega-sub-menu').animate(effect.animate, speed, function() {
54
  anchor.parent().removeClass('mega-toggle-on').triggerHandler("close_panel");
55
  });
 
 
 
56
  } else {
57
  anchor.parent().removeClass('mega-toggle-on').triggerHandler("close_panel");
 
58
  }
59
  } else {
60
  anchor.parent().removeClass('mega-toggle-on').triggerHandler("close_panel");
 
61
  }
62
 
63
  };
64
 
 
 
 
 
 
 
 
 
 
65
 
66
  plugin.hideAllPanels = function() {
67
  $('.mega-toggle-on > a', $menu).each(function() {
@@ -89,10 +107,14 @@
89
  return 'immediately';
90
  }
91
 
92
- if ( plugin.settings.vertical_behaviour == 'accordion' ) {
 
93
  return 'animated';
94
  }
95
 
 
 
 
96
  }
97
 
98
 
@@ -147,7 +169,7 @@
147
 
148
  if ( megamenu.effect[plugin.settings.effect] ) {
149
  var effect = megamenu.effect[plugin.settings.effect]['in'];
150
- var speed = megamenu.effect[plugin.settings.effect]['speed'] ? megamenu.effect[plugin.settings.effect]['speed'] : "fast";
151
 
152
  if (effect.css) {
153
  anchor.siblings('.mega-sub-menu').css(effect.css);
@@ -214,6 +236,7 @@
214
  timeout: megamenu.timeout,
215
  interval: megamenu.interval
216
  });
 
217
  };
218
 
219
  plugin.check_width = function() {
@@ -234,6 +257,48 @@
234
 
235
  }
236
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
  plugin.init = function() {
238
  plugin.settings = $.extend({}, defaults, options);
239
 
@@ -265,6 +330,8 @@
265
  plugin.check_width();
266
  });
267
 
 
 
268
  };
269
 
270
  plugin.init();
16
  var defaults = {
17
  event: $menu.attr('data-event'),
18
  effect: $menu.attr('data-effect'),
19
+ effect_speed: parseInt($menu.attr('data-effect-speed')),
20
  panel_width: $menu.attr('data-panel-width'),
21
  panel_inner_width: $menu.attr('data-panel-inner-width'),
22
  second_click: $menu.attr('data-second-click'),
37
  anchor.siblings('.mega-sub-menu').children('.mega-toggle-on').removeClass('mega-toggle-on');
38
 
39
  if (immediate) {
40
+ anchor.siblings('.mega-sub-menu').removeClass('mega-toggle-on');
41
  anchor.parent().removeClass('mega-toggle-on').triggerHandler("close_panel");
42
  return;
43
  }
44
 
45
+ var timeout = plugin.settings.effect_speed + parseInt(megamenu.timeout, 10);
46
+
47
  if ( megamenu.effect[plugin.settings.effect] ) {
48
  var effect = megamenu.effect[plugin.settings.effect]['out'];
49
+ var speed = plugin.settings.effect_speed;
50
 
51
  if (effect.css) {
52
  anchor.siblings('.mega-sub-menu').css(effect.css);
53
  }
54
 
55
  if (effect.animate) {
56
+
57
  anchor.siblings('.mega-sub-menu').animate(effect.animate, speed, function() {
58
  anchor.parent().removeClass('mega-toggle-on').triggerHandler("close_panel");
59
  });
60
+ anchor.siblings('.mega-sub-menu').each( function() {
61
+ add_animating_class(anchor.parent());
62
+ });
63
  } else {
64
  anchor.parent().removeClass('mega-toggle-on').triggerHandler("close_panel");
65
+ add_animating_class(anchor.parent());
66
  }
67
  } else {
68
  anchor.parent().removeClass('mega-toggle-on').triggerHandler("close_panel");
69
+ add_animating_class(anchor.parent());
70
  }
71
 
72
  };
73
 
74
+ var add_animating_class = function(element) {
75
+ var timeout = plugin.settings.effect_speed + parseInt(megamenu.timeout, 10);
76
+
77
+ element.addClass("mega-animating");
78
+
79
+ setTimeout(function() {
80
+ element.removeClass("mega-animating");
81
+ }, timeout );
82
+ }
83
 
84
  plugin.hideAllPanels = function() {
85
  $('.mega-toggle-on > a', $menu).each(function() {
107
  return 'immediately';
108
  }
109
 
110
+ // mobile, keyboard navigation
111
+ if ( ! plugin.isDesktopView() && $menu.hasClass('mega-keyboard-navigation') ) {
112
  return 'animated';
113
  }
114
 
115
+ if ( plugin.settings.vertical_behaviour == 'accordion' ) {
116
+ return 'animated';
117
+ }
118
  }
119
 
120
 
169
 
170
  if ( megamenu.effect[plugin.settings.effect] ) {
171
  var effect = megamenu.effect[plugin.settings.effect]['in'];
172
+ var speed = plugin.settings.effect_speed;
173
 
174
  if (effect.css) {
175
  anchor.siblings('.mega-sub-menu').css(effect.css);
236
  timeout: megamenu.timeout,
237
  interval: megamenu.interval
238
  });
239
+
240
  };
241
 
242
  plugin.check_width = function() {
257
 
258
  }
259
 
260
+
261
+ plugin.keyboard_navigation = function() {
262
+ var tab_key = 9;
263
+ var escape_key = 27;
264
+
265
+ $('body').on('keyup', function(e) {
266
+ var keyCode = e.keyCode || e.which;
267
+
268
+ if (keyCode == escape_key) {
269
+ $menu.removeClass('mega-keyboard-navigation');
270
+ plugin.hideAllPanels();
271
+ }
272
+
273
+ if ( $menu.hasClass('mega-keyboard-navigation') && ! $(event.target).closest(".mega-menu li").length ) {
274
+ $menu.removeClass('mega-keyboard-navigation');
275
+ plugin.hideAllPanels();
276
+ }
277
+ });
278
+
279
+ $menu.parent().on('keyup', function(e) {
280
+ var keyCode = e.keyCode || e.which;
281
+ var active_link = $(e.target);
282
+
283
+ if (keyCode == tab_key) {
284
+ $menu.addClass('mega-keyboard-navigation');
285
+
286
+ if ( active_link.parent().hasClass('mega-menu-item-has-children') && ( ! active_link.parents('.mega-menu-megamenu').length || active_link.parent().parent().hasClass('mega-menu') ) ) {
287
+ // menu item with sub menu
288
+ plugin.showPanel($(e.target));
289
+ } else if ( active_link.parent().parent().hasClass('mega-menu') ) {
290
+ // top level item with no children
291
+ plugin.hideAllPanels();
292
+ }
293
+
294
+ if ( active_link.hasClass('mega-menu-toggle') ) {
295
+ active_link.toggleClass('mega-menu-open');
296
+ }
297
+ }
298
+ });
299
+ }
300
+
301
+
302
  plugin.init = function() {
303
  plugin.settings = $.extend({}, defaults, options);
304
 
330
  plugin.check_width();
331
  });
332
 
333
+ plugin.keyboard_navigation();
334
+
335
  };
336
 
337
  plugin.init();
js/select2/select2.css CHANGED
@@ -102,7 +102,6 @@ html[dir="rtl"] .select2-container .select2-choice > .select2-chosen {
102
  text-decoration: none;
103
 
104
  border: 0;
105
- background: url('select2.png') right top no-repeat;
106
  cursor: pointer;
107
  outline: 0;
108
  }
@@ -211,7 +210,6 @@ html[dir="rtl"] .select2-container .select2-choice .select2-arrow {
211
  display: block;
212
  width: 100%;
213
  height: 100%;
214
- background: url('select2.png') no-repeat 0 1px;
215
  }
216
 
217
  html[dir="rtl"] .select2-container .select2-choice .select2-arrow b {
@@ -248,29 +246,14 @@ html[dir="rtl"] .select2-container .select2-choice .select2-arrow b {
248
  -webkit-box-shadow: none;
249
  box-shadow: none;
250
 
251
- background: #fff url('select2.png') no-repeat 100% -22px;
252
- background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
253
- background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
254
- background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
255
- background: url('select2.png') no-repeat 100% -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
256
  }
257
 
258
  html[dir="rtl"] .select2-search input {
259
  padding: 4px 5px 4px 20px;
260
 
261
- background: #fff url('select2.png') no-repeat -37px -22px;
262
- background: url('select2.png') no-repeat -37px -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
263
- background: url('select2.png') no-repeat -37px -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
264
- background: url('select2.png') no-repeat -37px -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
265
- background: url('select2.png') no-repeat -37px -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
266
  }
267
 
268
  .select2-search input.select2-active {
269
- background: #fff url('select2-spinner.gif') no-repeat 100%;
270
- background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
271
- background: url('select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
272
- background: url('select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
273
- background: url('select2-spinner.gif') no-repeat 100%, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
274
  }
275
 
276
  .select2-container-active .select2-choice,
@@ -598,7 +581,6 @@ html[dir="rtl"] .select2-container-multi .select2-choices .select2-search-choice
598
 
599
  font-size: 1px;
600
  outline: none;
601
- background: url('select2.png') right top no-repeat;
602
  }
603
  html[dir="rtl"] .select2-search-choice-close {
604
  right: auto;
102
  text-decoration: none;
103
 
104
  border: 0;
 
105
  cursor: pointer;
106
  outline: 0;
107
  }
210
  display: block;
211
  width: 100%;
212
  height: 100%;
 
213
  }
214
 
215
  html[dir="rtl"] .select2-container .select2-choice .select2-arrow b {
246
  -webkit-box-shadow: none;
247
  box-shadow: none;
248
 
 
 
 
 
 
249
  }
250
 
251
  html[dir="rtl"] .select2-search input {
252
  padding: 4px 5px 4px 20px;
253
 
 
 
 
 
 
254
  }
255
 
256
  .select2-search input.select2-active {
 
 
 
 
 
257
  }
258
 
259
  .select2-container-active .select2-choice,
581
 
582
  font-size: 1px;
583
  outline: none;
 
584
  }
585
  html[dir="rtl"] .select2-search-choice-close {
586
  right: auto;
js/toggledesigner.js CHANGED
@@ -66,7 +66,7 @@ jQuery(function($) {
66
 
67
 
68
  // Delete block
69
- $( ".block-settings a.mega-delete").live('click', function(e) {
70
  e.preventDefault();
71
  $(this).parent(".block-settings").parent(".block").remove();
72
  reindex_blocks();
@@ -74,7 +74,7 @@ jQuery(function($) {
74
 
75
 
76
  // Show/hide block settings
77
- $( ".block-title span").live('click', function() {
78
  var settings = $(this).parent().parent().find(".block-settings");
79
  $(".block").removeClass('mega-open');
80
 
66
 
67
 
68
  // Delete block
69
+ $( ".block-settings").on('click', 'a.mega-delete', function(e) {
70
  e.preventDefault();
71
  $(this).parent(".block-settings").parent(".block").remove();
72
  reindex_blocks();
74
 
75
 
76
  // Show/hide block settings
77
+ $( ".block-title").on('click', 'span', function() {
78
  var settings = $(this).parent().parent().find(".block-settings");
79
  $(".block").removeClass('mega-open');
80
 
megamenu.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Max Mega Menu
5
  * Plugin URI: https://www.maxmegamenu.com
6
  * Description: Mega Menu for WordPress.
7
- * Version: 2.1.5
8
  * Author: Tom Hemsley
9
  * Author URI: https://www.maxmegamenu.com
10
  * License: GPL-2.0+
@@ -26,7 +26,7 @@ final class Mega_Menu {
26
  /**
27
  * @var string
28
  */
29
- public $version = '2.1.5';
30
 
31
 
32
  /**
@@ -63,6 +63,9 @@ final class Mega_Menu {
63
  add_filter( 'megamenu_nav_menu_objects_after', array( $this, 'apply_classes_to_menu_items' ), 7, 2 );
64
 
65
  add_filter( 'megamenu_nav_menu_css_class', array( $this, 'prefix_menu_classes' ) );
 
 
 
66
  add_filter( 'black_studio_tinymce_enable_pages' , array($this, 'megamenu_blackstudio_tinymce' ) );
67
 
68
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts'), 11 );
@@ -76,12 +79,10 @@ final class Mega_Menu {
76
  add_shortcode( 'maxmegamenu', array( $this, 'register_shortcode' ) );
77
 
78
  if ( is_admin() ) {
79
-
80
  new Mega_Menu_Nav_Menus();
81
  new Mega_Menu_Widget_Manager();
82
  new Mega_Menu_Menu_Item_Manager();
83
  new Mega_Menu_Settings();
84
-
85
  }
86
 
87
  if ( class_exists( 'Mega_Menu_Toggle_Blocks' ) ) {
@@ -103,12 +104,21 @@ final class Mega_Menu {
103
 
104
  wp_enqueue_style( 'maxmegamenu-global', MEGAMENU_BASE_URL . 'css/admin/global.css', array(), MEGAMENU_VERSION );
105
 
106
- if ( 'nav-menus.php' == $hook ) {
107
- do_action("megamenu_nav_menus_scripts", $hook );
108
- }
 
 
 
 
 
 
 
 
 
 
 
109
 
110
- if ( strpos( $hook, 'maxmegamenu' ) !== false ) {
111
- do_action("megamenu_admin_scripts", $hook );
112
  }
113
 
114
  }
@@ -370,7 +380,7 @@ final class Mega_Menu {
370
 
371
  $content = apply_filters( "megamenu_toggle_bar_content", $content, $nav_menu, $args, $theme_id );
372
 
373
- $replace = $find . '<div class="mega-menu-toggle">' . $content . '</div>';
374
 
375
  return str_replace( $find, $replace, $nav_menu );
376
 
@@ -702,17 +712,39 @@ final class Mega_Menu {
702
  $menu_theme = mmm_get_theme_for_location( $current_theme_location );
703
  $menu_settings = $settings[ $current_theme_location ];
704
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
705
  $wrap_attributes = apply_filters("megamenu_wrap_attributes", array(
706
  "id" => '%1$s',
707
  "class" => '%2$s mega-no-js',
708
  "data-event" => isset( $menu_settings['event'] ) ? $menu_settings['event'] : 'hover',
709
- "data-effect" => isset( $menu_settings['effect'] ) ? $menu_settings['effect'] : 'disabled',
 
710
  "data-panel-width" => preg_match('/^\d/', $menu_theme['panel_width']) !== 1 ? $menu_theme['panel_width'] : '',
711
  "data-panel-inner-width" => substr( $menu_theme['panel_inner_width'], -1 ) !== '%' ? $menu_theme['panel_inner_width'] : '',
712
- "data-second-click" => isset( $settings['second_click'] ) ? $settings['second_click'] : 'close',
713
  "data-document-click" => 'collapse',
714
  "data-reverse-mobile-items" => 'true',
715
- "data-vertical-behaviour" => isset( $settings['mobile_behaviour'] ) ? $settings['mobile_behaviour'] : 'standard',
716
  "data-breakpoint" => absint( $menu_theme['responsive_breakpoint'] )
717
  ), $menu_id, $menu_settings, $settings, $current_theme_location );
718
 
@@ -784,6 +816,7 @@ final class Mega_Menu {
784
  $css = get_transient("megamenu_css");
785
 
786
  if ( $css && version_compare( $this->version, $css_version, '!=' ) ) :
 
787
  ?>
788
  <div class="updated">
789
  <?php
@@ -816,6 +849,14 @@ final class Mega_Menu {
816
  return $wp_version >= 3.8;
817
  }
818
 
 
 
 
 
 
 
 
 
819
 
820
  }
821
 
4
  * Plugin Name: Max Mega Menu
5
  * Plugin URI: https://www.maxmegamenu.com
6
  * Description: Mega Menu for WordPress.
7
+ * Version: 2.2
8
  * Author: Tom Hemsley
9
  * Author URI: https://www.maxmegamenu.com
10
  * License: GPL-2.0+
26
  /**
27
  * @var string
28
  */
29
+ public $version = '2.2';
30
 
31
 
32
  /**
63
  add_filter( 'megamenu_nav_menu_objects_after', array( $this, 'apply_classes_to_menu_items' ), 7, 2 );
64
 
65
  add_filter( 'megamenu_nav_menu_css_class', array( $this, 'prefix_menu_classes' ) );
66
+
67
+ // plugin compatibility
68
+ add_filter( 'conditional_menus_theme_location', array( $this, 'conditional_menus_restore_theme_location'), 10, 3 );
69
  add_filter( 'black_studio_tinymce_enable_pages' , array($this, 'megamenu_blackstudio_tinymce' ) );
70
 
71
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts'), 11 );
79
  add_shortcode( 'maxmegamenu', array( $this, 'register_shortcode' ) );
80
 
81
  if ( is_admin() ) {
 
82
  new Mega_Menu_Nav_Menus();
83
  new Mega_Menu_Widget_Manager();
84
  new Mega_Menu_Menu_Item_Manager();
85
  new Mega_Menu_Settings();
 
86
  }
87
 
88
  if ( class_exists( 'Mega_Menu_Toggle_Blocks' ) ) {
104
 
105
  wp_enqueue_style( 'maxmegamenu-global', MEGAMENU_BASE_URL . 'css/admin/global.css', array(), MEGAMENU_VERSION );
106
 
107
+ if ( ! wp_script_is('mega-menu') ) {
108
+
109
+ if ( 'nav-menus.php' == $hook ) {
110
+ // load widget scripts and styles first to allow us to dequeue conflicting colorbox scripts from other plugins
111
+ do_action( 'sidebar_admin_setup' );
112
+ do_action( 'admin_enqueue_scripts', 'widgets.php' );
113
+ do_action( 'admin_print_styles-widgets.php' );
114
+
115
+ do_action("megamenu_nav_menus_scripts", $hook );
116
+ }
117
+
118
+ if ( strpos( $hook, 'maxmegamenu' ) !== false ) {
119
+ do_action("megamenu_admin_scripts", $hook );
120
+ }
121
 
 
 
122
  }
123
 
124
  }
380
 
381
  $content = apply_filters( "megamenu_toggle_bar_content", $content, $nav_menu, $args, $theme_id );
382
 
383
+ $replace = $find . '<div class="mega-menu-toggle" tabindex="0">' . $content . '</div>';
384
 
385
  return str_replace( $find, $replace, $nav_menu );
386
 
712
  $menu_theme = mmm_get_theme_for_location( $current_theme_location );
713
  $menu_settings = $settings[ $current_theme_location ];
714
 
715
+ $effect = isset( $menu_settings['effect'] ) ? $menu_settings['effect'] : 'disabled';
716
+
717
+ // convert Pro JS based effect to CSS3 effect
718
+ if ( $effect == 'fadeUp' ) {
719
+ $effect = 'fade_up';
720
+ }
721
+
722
+ // as set on the main settings page
723
+ $vertical_behaviour = isset( $settings['mobile_behaviour'] ) ? $settings['mobile_behaviour'] : 'standard';
724
+
725
+ if ( isset( $menu_settings['mobile_behaviour'] ) ) {
726
+ $vertical_behaviour = $menu_settings['mobile_behaviour'];
727
+ }
728
+
729
+ // as set on the main settings page
730
+ $second_click = isset( $settings['second_click'] ) ? $settings['second_click'] : 'close';
731
+
732
+ if ( isset( $menu_settings['second_click'] ) ) {
733
+ $second_click = $menu_settings['second_click'];
734
+ }
735
+
736
  $wrap_attributes = apply_filters("megamenu_wrap_attributes", array(
737
  "id" => '%1$s',
738
  "class" => '%2$s mega-no-js',
739
  "data-event" => isset( $menu_settings['event'] ) ? $menu_settings['event'] : 'hover',
740
+ "data-effect" => $effect,
741
+ "data-effect-speed" => isset( $menu_settings['effect_speed'] ) ? $menu_settings['effect_speed'] : '200',
742
  "data-panel-width" => preg_match('/^\d/', $menu_theme['panel_width']) !== 1 ? $menu_theme['panel_width'] : '',
743
  "data-panel-inner-width" => substr( $menu_theme['panel_inner_width'], -1 ) !== '%' ? $menu_theme['panel_inner_width'] : '',
744
+ "data-second-click" => $second_click,
745
  "data-document-click" => 'collapse',
746
  "data-reverse-mobile-items" => 'true',
747
+ "data-vertical-behaviour" => $vertical_behaviour,
748
  "data-breakpoint" => absint( $menu_theme['responsive_breakpoint'] )
749
  ), $menu_id, $menu_settings, $settings, $current_theme_location );
750
 
816
  $css = get_transient("megamenu_css");
817
 
818
  if ( $css && version_compare( $this->version, $css_version, '!=' ) ) :
819
+
820
  ?>
821
  <div class="updated">
822
  <?php
849
  return $wp_version >= 3.8;
850
  }
851
 
852
+ /**
853
+ * Add compatibility for conditional menus plugin
854
+ *
855
+ * @since 2.2
856
+ */
857
+ public function conditional_menus_restore_theme_location( $location, $new_args, $old_args ) {
858
+ return $old_args['theme_location'];
859
+ }
860
 
861
  }
862
 
readme.txt CHANGED
@@ -92,6 +92,30 @@ See https://www.maxmegamenu.com for more screenshots
92
 
93
  == Changelog ==
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  = 2.1.5 [13/04/2016] =
96
 
97
  * Change: Allow "Hide Text" option to be used on second level menu items
92
 
93
  == Changelog ==
94
 
95
+ = 2.2 =
96
+
97
+ * New feature: CSS3 dropdown animations
98
+ * New feature: Animation speed setting
99
+ * New Feature: Accessibility (allow tab navigation of menus)
100
+ * Improvement: Load widgets.php scripts on nav-menus.php page to improve widget compatibility
101
+ * Improvement: Remove upgrade nags from icons tab
102
+ * Improvement: Add search to icons
103
+ * Improvement: Preselect last edited theme in theme editor
104
+ * Improvement: Only allow widget titles to be dragged in menu builder
105
+ * Improvement: Add 'Mobile menu background' and 'Disable mobile toggle' settings to theme editor
106
+ * Fix: Move toggle block IDs to classes to avoid validation errors
107
+ * Fix: Replace deprecated jQuery 'live' function calls with 'on'
108
+ * Fix: select2.png 404 in admin
109
+ * Fix: Reinstate icon margin on sub menu items when parent item has 'Hide text' enabled
110
+ * Fix: Active menu item border color
111
+ * Fix: Third level menu item visibility when JS is disabled
112
+ * Fix: Compatibility with Conditional Menus
113
+ * Fix: Compatibility with WordFence
114
+ * Fix: Compatibility with Image Widget Deluxe
115
+ * Fix: Widget titles wrapping onto two lines in mega menu builder
116
+ * Fix: Admin elements disappearing randomly in webkit browsers
117
+ * Change: Reset Widget Styling theme option - default changed from 'On' to 'Off'
118
+
119
  = 2.1.5 [13/04/2016] =
120
 
121
  * Change: Allow "Hide Text" option to be used on second level menu items