Version Description
- Improvement: Use core version of CodeMirror (requires WordPress 4.9+)
- Improvement: Performance on grid layout sub menus
- Improvement: Accessibility - keyboard navigation and screen reader improvements
- Improvement: Allow a container_id to be specified as an Active Menu Instance
- Improvement: Swap out admin menu icon from font icon to SVG
- Fix: JS Lint JavaScript
- Fix: Compatiblity with ACF Pro Select2 fields
- Fix: WPML Language selector. Language selector position now respects the position set in the WPML options
- Fix: Apply 'no-headers' styling to grid layout sub menus
- Fix: 'Hide Sub Menu on mobile' option doesn't apply to mega menus
- Fix: Prevent CSS from being auto loaded
- Fix: Grid Layout: Title and descriprion are pushed below the icon when the description wraps onto two lines
- Change: Always show mega-indicator arrow on mobile (allows for unbinding events from the link itself)
Download this release
Release Info
Developer | megamenu |
Plugin | Max Mega Menu |
Version | 2.6 |
Comparing to | |
See all releases |
Code changes from version 2.5.3.2 to 2.6
- classes/menu-item-manager.class.php +1 -1
- classes/settings.class.php +23 -11
- classes/style-manager.class.php +11 -4
- classes/toggle-blocks.class.php +19 -20
- classes/walker.class.php +21 -9
- classes/widget-manager.class.php +23 -15
- css/admin/admin.css +5 -2
- css/admin/admin.scss +6 -2
- css/admin/global.css +0 -19
- css/megamenu.scss +65 -22
- css/toggle-blocks.scss +2 -0
- font/maxmegamenu.eot +0 -0
- font/maxmegamenu.svg +0 -12
- font/maxmegamenu.ttf +0 -0
- font/maxmegamenu.woff +0 -0
- font/maxmegamenu.woff2 +0 -0
- js/admin.js +10 -0
- js/maxmegamenu.js +153 -49
- js/settings.js +1 -9
- megamenu.php +33 -15
- readme.txt +19 -3
classes/menu-item-manager.class.php
CHANGED
@@ -817,7 +817,7 @@ class Mega_Menu_Menu_Item_Manager {
|
|
817 |
|
818 |
$return .= "<div class='{$type}'>";
|
819 |
$return .= " <input class='radio' id='{$class}' type='radio' rel='{$code}' name='settings[icon]' value='{$class}' " . checked( $this->menu_item_meta['icon'], $class, false ) . " />";
|
820 |
-
$return .= " <label rel='{$code}' for='{$class}'></label>";
|
821 |
$return .= "</div>";
|
822 |
|
823 |
}
|
817 |
|
818 |
$return .= "<div class='{$type}'>";
|
819 |
$return .= " <input class='radio' id='{$class}' type='radio' rel='{$code}' name='settings[icon]' value='{$class}' " . checked( $this->menu_item_meta['icon'], $class, false ) . " />";
|
820 |
+
$return .= " <label rel='{$code}' for='{$class}' title='{$class}'></label>";
|
821 |
$return .= "</div>";
|
822 |
|
823 |
}
|
classes/settings.class.php
CHANGED
@@ -639,8 +639,11 @@ class Mega_Menu_Settings {
|
|
639 |
*/
|
640 |
public function megamenu_themes_page() {
|
641 |
|
642 |
-
$
|
643 |
|
|
|
|
|
|
|
644 |
|
645 |
$tabs = apply_filters("megamenu_menu_tabs", array(
|
646 |
'general_settings' => __("General Settings", "megamenu"),
|
@@ -1116,7 +1119,7 @@ class Mega_Menu_Settings {
|
|
1116 |
<tr>
|
1117 |
<td class='mega-name'>
|
1118 |
<?php _e("Cache", "megamenu"); ?>
|
1119 |
-
<div class='mega-description'><?php _e("The CSS
|
1120 |
</td>
|
1121 |
<td class='mega-value'>
|
1122 |
<form action="<?php echo admin_url('admin-post.php'); ?>" method="post">
|
@@ -1124,6 +1127,10 @@ class Mega_Menu_Settings {
|
|
1124 |
<input type="hidden" name="action" value="megamenu_clear_css_cache" />
|
1125 |
|
1126 |
<input type='submit' class='button button-secondary' value='<?php _e("Clear CSS Cache", "megamenu"); ?>' />
|
|
|
|
|
|
|
|
|
1127 |
</form>
|
1128 |
</td>
|
1129 |
</tr>
|
@@ -1852,8 +1859,13 @@ class Mega_Menu_Settings {
|
|
1852 |
)
|
1853 |
)
|
1854 |
),
|
|
|
|
|
|
|
|
|
|
|
1855 |
'menu_item_align' => array(
|
1856 |
-
'priority' =>
|
1857 |
'title' => __( "Menu Items Align", "megamenu" ),
|
1858 |
'description' => __( "Align <i>all</i> menu items to the left (default), centrally or to the right.", "megamenu" ),
|
1859 |
'info' => array( __( "This option will apply to all menu items. To align an individual menu item to the right, edit the menu item itself and set 'Menu Item Align' to 'Right'.", "megamenu" ) ),
|
@@ -1865,11 +1877,6 @@ class Mega_Menu_Settings {
|
|
1865 |
)
|
1866 |
)
|
1867 |
),
|
1868 |
-
'top_level_menu_items' => array(
|
1869 |
-
'priority' => 50,
|
1870 |
-
'title' => __( "Top Level Menu Items", "megamenu" ),
|
1871 |
-
'description' => '',
|
1872 |
-
),
|
1873 |
'menu_item_background' => array(
|
1874 |
'priority' => 60,
|
1875 |
'title' => __( "Menu Item Background", "megamenu" ),
|
@@ -1996,6 +2003,7 @@ class Mega_Menu_Settings {
|
|
1996 |
'priority' => 120,
|
1997 |
'title' => __( "Menu Item Padding", "megamenu" ),
|
1998 |
'description' => __( "Set the padding for each top level menu item.", "megamenu" ),
|
|
|
1999 |
'settings' => array(
|
2000 |
array(
|
2001 |
'title' => __( "Top", "megamenu" ),
|
@@ -3952,14 +3960,18 @@ class Mega_Menu_Settings {
|
|
3952 |
wp_enqueue_style( 'spectrum', MEGAMENU_BASE_URL . 'js/spectrum/spectrum.css', false, MEGAMENU_VERSION );
|
3953 |
wp_enqueue_style( 'mega-menu-settings', MEGAMENU_BASE_URL . 'css/admin/admin.css', false, MEGAMENU_VERSION );
|
3954 |
wp_deregister_style('codemirror');
|
3955 |
-
wp_enqueue_style( 'mega-menu-codemirror', MEGAMENU_BASE_URL . 'js/codemirror/codemirror.css', false, MEGAMENU_VERSION );
|
3956 |
wp_enqueue_style( 'select2', MEGAMENU_BASE_URL . 'js/select2/select2.css', false, MEGAMENU_VERSION );
|
3957 |
|
3958 |
wp_enqueue_script( 'spectrum', MEGAMENU_BASE_URL . 'js/spectrum/spectrum.js', array( 'jquery' ), MEGAMENU_VERSION );
|
3959 |
wp_deregister_script('codemirror');
|
3960 |
-
|
|
|
|
|
|
|
|
|
|
|
3961 |
wp_enqueue_script( 'mega-menu-select2', MEGAMENU_BASE_URL . 'js/select2/select2.min.js', array(), MEGAMENU_VERSION );
|
3962 |
-
wp_enqueue_script( 'mega-menu-theme-editor', MEGAMENU_BASE_URL . 'js/settings.js', array( 'jquery', 'spectrum'
|
3963 |
|
3964 |
wp_localize_script( 'mega-menu-theme-editor', 'megamenu_settings',
|
3965 |
array(
|
639 |
*/
|
640 |
public function megamenu_themes_page() {
|
641 |
|
642 |
+
$svg = 'PHN2ZyB2ZXJzaW9uPSIxLjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEyNy4wMDAwMDBwdCIgaGVpZ2h0PSIxMjcuMDAwMDAwcHQiIHZpZXdCb3g9IjAgMCAxMjcuMDAwMDAwIDEyNy4wMDAwMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIG1lZXQiPgogICAgICAgICAgICAgICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAuMDAwMDAwLDEyNy4wMDAwMDApIHNjYWxlKDAuMTAwMDAwLC0wLjEwMDAwMCkiIGZpbGw9IiMwMDAwMDAiIHN0cm9rZT0ibm9uZSI+CiAgICAgICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0zMzAgMTEyNyBsLTI0NSAtMTQzIC03IC0xODAgYy01IC05OCAtNyAtMjUzIC01IC0zNDQgbDIgLTE2NSAxMzAKICAgICAgICAgICAgICAgICAgICAgICAgLTc2IGMyOTUgLTE3MyAzNDUgLTIwNCAzNDUgLTIxMSAwIC00IDI0IC04IDU0IC04IDQ4IDAgNjUgNyAxNjcgNjYgMjIzIDEyOQogICAgICAgICAgICAgICAgICAgICAgICAzNzYgMjI0IDM5MCAyNDAgMTggMjEgMjYgNTkzIDEwIDYzNyAtMTIgMzAgLTczIDcyIC0yNzYgMTkwIC03MSA0MiAtMTUyIDkwCiAgICAgICAgICAgICAgICAgICAgICAgIC0xNzkgMTA2IC0zNiAyMyAtNjAgMzEgLTk1IDMxIC00MSAwIC03MiAtMTYgLTI5MSAtMTQzeiBtNDEwIC03NyBjMTMxIC03NgogICAgICAgICAgICAgICAgICAgICAgICAxNDEgLTg1IDExNSAtMTA1IC00MyAtMzEgLTIyMSAtMTI1IC0yMzkgLTEyNSAtMjEgMCAtMjE3IDExMiAtMjM1IDEzNCAtOCAxMAogICAgICAgICAgICAgICAgICAgICAgICAtNiAxNyA3IDI4IDM3IDMyIDIwNyAxMjggMjI2IDEyOCAxMiAwIDY4IC0yNyAxMjYgLTYweiBtLTM2MSAtMjc5IGM4OCAtNTAKICAgICAgICAgICAgICAgICAgICAgICAgMTgxIC05OSAyMDcgLTExMCBsNDcgLTIxIDEyMSA2OSBjMTY4IDk2IDI1NSAxNDEgMjcyIDE0MSAxMiAwIDE0IC0zOCAxNCAtMjI4CiAgICAgICAgICAgICAgICAgICAgICAgIGwwIC0yMjggLTc3IC00NyAtNzggLTQ3IC03IDE0NiBjLTMgODAgLTggMTQ3IC0xMCAxNDkgLTIgMiAtNTMgLTI1IC0xMTMgLTYwCiAgICAgICAgICAgICAgICAgICAgICAgIC02MSAtMzUgLTExOSAtNjQgLTEyOSAtNjUgLTExIDAgLTcwIDI3IC0xMzIgNjAgLTYyIDMzIC0xMTUgNjAgLTExNyA2MCAtMyAwCiAgICAgICAgICAgICAgICAgICAgICAgIC04IC02MyAtMTIgLTE0MCAtNCAtNzcgLTExIC0xNDAgLTE2IC0xNDAgLTQgMCAtMzkgMTkgLTc4IDQyIGwtNzAgNDIgLTMgMTI2CiAgICAgICAgICAgICAgICAgICAgICAgIGMtNCAxODIgMSAzNDAgMTIgMzQwIDUgMCA4MSAtNDAgMTY5IC04OXogbTE5NSAtNDU4IGw1NSAtMjcgNDEgMjggYzIzIDE1IDQ4CiAgICAgICAgICAgICAgICAgICAgICAgIDI1IDU2IDIyIDE1IC02IDIwIC03OSA4IC0xMTEgLTcgLTE4IC05NCAtNjUgLTEyMSAtNjUgLTIyIDAgLTgzIDM1IC0xMDAgNTgKICAgICAgICAgICAgICAgICAgICAgICAgLTE4IDIyIC0xNSAxMjIgMyAxMjIgMiAwIDI4IC0xMiA1OCAtMjd6Ii8+CiAgICAgICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPC9zdmc+';
|
643 |
|
644 |
+
$icon = "data:image/svg+xml;base64," . $svg;
|
645 |
+
|
646 |
+
$page = add_menu_page( __('Max Mega Menu', 'megamenu'), __('Mega Menu', 'megamenu'), 'edit_theme_options', 'maxmegamenu', array($this, 'page'), $icon );
|
647 |
|
648 |
$tabs = apply_filters("megamenu_menu_tabs", array(
|
649 |
'general_settings' => __("General Settings", "megamenu"),
|
1119 |
<tr>
|
1120 |
<td class='mega-name'>
|
1121 |
<?php _e("Cache", "megamenu"); ?>
|
1122 |
+
<div class='mega-description'><?php _e("The CSS for your menu is updated each time a menu or a menu theme is changed. You can force the menu CSS to be updated using this tool.", "megamenu"); ?></div>
|
1123 |
</td>
|
1124 |
<td class='mega-value'>
|
1125 |
<form action="<?php echo admin_url('admin-post.php'); ?>" method="post">
|
1127 |
<input type="hidden" name="action" value="megamenu_clear_css_cache" />
|
1128 |
|
1129 |
<input type='submit' class='button button-secondary' value='<?php _e("Clear CSS Cache", "megamenu"); ?>' />
|
1130 |
+
|
1131 |
+
<?php if ( get_transient( 'megamenu_css_last_updated' ) ): ?>
|
1132 |
+
<p><em><small><?php echo sprintf(__("The menu CSS was last updated on %s", "megamenu"), date('l jS F Y H:i:s', get_transient('megamenu_css_last_updated') ) ); ?><small><em></p>
|
1133 |
+
<?php endif; ?>
|
1134 |
</form>
|
1135 |
</td>
|
1136 |
</tr>
|
1859 |
)
|
1860 |
)
|
1861 |
),
|
1862 |
+
'top_level_menu_items' => array(
|
1863 |
+
'priority' => 50,
|
1864 |
+
'title' => __( "Top Level Menu Items", "megamenu" ),
|
1865 |
+
'description' => '',
|
1866 |
+
),
|
1867 |
'menu_item_align' => array(
|
1868 |
+
'priority' => 55,
|
1869 |
'title' => __( "Menu Items Align", "megamenu" ),
|
1870 |
'description' => __( "Align <i>all</i> menu items to the left (default), centrally or to the right.", "megamenu" ),
|
1871 |
'info' => array( __( "This option will apply to all menu items. To align an individual menu item to the right, edit the menu item itself and set 'Menu Item Align' to 'Right'.", "megamenu" ) ),
|
1877 |
)
|
1878 |
)
|
1879 |
),
|
|
|
|
|
|
|
|
|
|
|
1880 |
'menu_item_background' => array(
|
1881 |
'priority' => 60,
|
1882 |
'title' => __( "Menu Item Background", "megamenu" ),
|
2003 |
'priority' => 120,
|
2004 |
'title' => __( "Menu Item Padding", "megamenu" ),
|
2005 |
'description' => __( "Set the padding for each top level menu item.", "megamenu" ),
|
2006 |
+
'info' => array( __( "Generally we advise against using the Top and Bottom options here. Use the 'Menu Height' setting to determine the height of your top level menu items.", "megamenu" ) ),
|
2007 |
'settings' => array(
|
2008 |
array(
|
2009 |
'title' => __( "Top", "megamenu" ),
|
3960 |
wp_enqueue_style( 'spectrum', MEGAMENU_BASE_URL . 'js/spectrum/spectrum.css', false, MEGAMENU_VERSION );
|
3961 |
wp_enqueue_style( 'mega-menu-settings', MEGAMENU_BASE_URL . 'css/admin/admin.css', false, MEGAMENU_VERSION );
|
3962 |
wp_deregister_style('codemirror');
|
|
|
3963 |
wp_enqueue_style( 'select2', MEGAMENU_BASE_URL . 'js/select2/select2.css', false, MEGAMENU_VERSION );
|
3964 |
|
3965 |
wp_enqueue_script( 'spectrum', MEGAMENU_BASE_URL . 'js/spectrum/spectrum.js', array( 'jquery' ), MEGAMENU_VERSION );
|
3966 |
wp_deregister_script('codemirror');
|
3967 |
+
|
3968 |
+
$cm_settings['codeEditor'] = wp_enqueue_code_editor(array('type' => 'text/x-scss'));
|
3969 |
+
wp_localize_script('jquery', 'cm_settings', $cm_settings);
|
3970 |
+
|
3971 |
+
wp_enqueue_style('wp-codemirror');
|
3972 |
+
|
3973 |
wp_enqueue_script( 'mega-menu-select2', MEGAMENU_BASE_URL . 'js/select2/select2.min.js', array(), MEGAMENU_VERSION );
|
3974 |
+
wp_enqueue_script( 'mega-menu-theme-editor', MEGAMENU_BASE_URL . 'js/settings.js', array( 'jquery', 'spectrum' ), MEGAMENU_VERSION );
|
3975 |
|
3976 |
wp_localize_script( 'mega-menu-theme-editor', 'megamenu_settings',
|
3977 |
array(
|
classes/style-manager.class.php
CHANGED
@@ -473,7 +473,7 @@ final class Mega_Menu_Style_Manager {
|
|
473 |
}
|
474 |
}
|
475 |
|
476 |
-
$css = "/** " . date('l jS F Y H:i:s e') . " ({$scss_location}) **/\n/** THIS FILE IS AUTOMATICALLY GENERATED - DO NOT MAKE MANUAL EDITS! **/\n/** Custom CSS should be added to Mega Menu > Menu Themes > Custom Styling **/\n\n" . $css;
|
477 |
|
478 |
$css = apply_filters( "megamenu_compiled_css", $css );
|
479 |
|
@@ -518,7 +518,10 @@ final class Mega_Menu_Style_Manager {
|
|
518 |
$settings['css'] = 'head';
|
519 |
update_option( 'megamenu_settings', $settings );
|
520 |
$this->settings = get_option( "megamenu_settings" );
|
521 |
-
|
|
|
|
|
|
|
522 |
}
|
523 |
|
524 |
}
|
@@ -907,8 +910,12 @@ final class Mega_Menu_Style_Manager {
|
|
907 |
*/
|
908 |
private function set_cached_css( $css ) {
|
909 |
|
910 |
-
|
911 |
-
|
|
|
|
|
|
|
|
|
912 |
|
913 |
}
|
914 |
|
473 |
}
|
474 |
}
|
475 |
|
476 |
+
$css = "/** " . date('l jS F Y H:i:s e') . " ({$scss_location}) **/\n/** THIS FILE IS AUTOMATICALLY GENERATED - DO NOT MAKE MANUAL EDITS! **/\n/** Custom CSS should be added to Mega Menu > Menu Themes > Custom Styling **/\n\n.mega-menu-last-modified-" . time() . " {\n\tcontent: '" . date('l jS F Y H:i:s e') . "';\n}\n\n" . $css;
|
477 |
|
478 |
$css = apply_filters( "megamenu_compiled_css", $css );
|
479 |
|
518 |
$settings['css'] = 'head';
|
519 |
update_option( 'megamenu_settings', $settings );
|
520 |
$this->settings = get_option( "megamenu_settings" );
|
521 |
+
|
522 |
+
// set a far expiration date to prevent transient from being autoloaded
|
523 |
+
$hundred_years_in_seconds = 3153600000;
|
524 |
+
set_transient( 'megamenu_failed_to_write_css_to_filesystem', 'true', $hundred_years_in_seconds );
|
525 |
}
|
526 |
|
527 |
}
|
910 |
*/
|
911 |
private function set_cached_css( $css ) {
|
912 |
|
913 |
+
// set a far expiration date to prevent transient from being autoloaded
|
914 |
+
$hundred_years_in_seconds = 3153600000;
|
915 |
+
|
916 |
+
set_transient( $this->get_transient_key(), $css, $hundred_years_in_seconds );
|
917 |
+
set_transient( 'megamenu_css_version', MEGAMENU_VERSION, $hundred_years_in_seconds );
|
918 |
+
set_transient( 'megamenu_css_last_updated', time(), $hundred_years_in_seconds );
|
919 |
|
920 |
}
|
921 |
|
classes/toggle-blocks.class.php
CHANGED
@@ -67,7 +67,7 @@ class Mega_Menu_Toggle_Blocks {
|
|
67 |
$closed_text = isset( $settings['closed_text'] ) ? do_shortcode( stripslashes( $settings['closed_text'] ) ) : "MENU";
|
68 |
$open_text = isset( $settings['open_text'] ) ? do_shortcode( stripslashes( $settings['open_text'] ) ) : "MENU";
|
69 |
|
70 |
-
$html = "<span class='mega-toggle-label'><span class='mega-toggle-label-closed'>{$closed_text}</span><span class='mega-toggle-label-open'>{$open_text}</span></span>";
|
71 |
} else {
|
72 |
$html = "";
|
73 |
}
|
@@ -241,10 +241,16 @@ class Mega_Menu_Toggle_Blocks {
|
|
241 |
|
242 |
$id = apply_filters('megamenu_toggle_block_id', 'mega-toggle-block-' . $block_id);
|
243 |
|
244 |
-
$
|
245 |
"class" => "mega-toggle-block {$class} mega-toggle-block-{$block_id}",
|
246 |
-
"id" => "mega-toggle-block-{$block_id}"
|
247 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
|
249 |
$block_html .= "<div";
|
250 |
|
@@ -461,23 +467,11 @@ class Mega_Menu_Toggle_Blocks {
|
|
461 |
$open_icon = 'disabled';
|
462 |
}
|
463 |
|
464 |
-
if ( isset( $settings['closed_text'] ) ) {
|
465 |
-
$closed_text = "'" . do_shortcode( stripslashes( html_entity_decode( $settings['closed_text'], ENT_QUOTES ) ) ) . "'";
|
466 |
-
} else {
|
467 |
-
$closed_text = "'MENU'";
|
468 |
-
}
|
469 |
-
|
470 |
-
if ( isset( $settings['open_text'] ) ) {
|
471 |
-
$open_text = "'" . do_shortcode( stripslashes( html_entity_decode( $settings['open_text'], ENT_QUOTES ) ) ) . "'";
|
472 |
-
} else {
|
473 |
-
$open_text = "''";
|
474 |
-
}
|
475 |
-
|
476 |
$styles = array(
|
477 |
'id' => $index,
|
478 |
'align' => isset($settings['align']) ? "'" . $settings['align'] . "'" : "'right'",
|
479 |
-
'closed_text' =>
|
480 |
-
'open_text' =>
|
481 |
'closed_icon' => $closed_icon != 'disabled' ? "'\\" . $closed_icon . "'" : "''",
|
482 |
'open_icon' => $open_icon != 'disabled' ? "'\\" . $open_icon . "'" : "''",
|
483 |
'text_color' => isset($settings['text_color']) ? $settings['text_color'] : '#fff',
|
@@ -863,8 +857,9 @@ class Mega_Menu_Toggle_Blocks {
|
|
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>
|
@@ -889,7 +884,8 @@ class Mega_Menu_Toggle_Blocks {
|
|
889 |
|
890 |
$defaults = array(
|
891 |
'icon_scale' => '0.8',
|
892 |
-
'icon_color' => 'rgb(221, 221, 221)'
|
|
|
893 |
);
|
894 |
|
895 |
$settings = array_merge( $defaults, $settings );
|
@@ -916,6 +912,9 @@ class Mega_Menu_Toggle_Blocks {
|
|
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>
|
67 |
$closed_text = isset( $settings['closed_text'] ) ? do_shortcode( stripslashes( $settings['closed_text'] ) ) : "MENU";
|
68 |
$open_text = isset( $settings['open_text'] ) ? do_shortcode( stripslashes( $settings['open_text'] ) ) : "MENU";
|
69 |
|
70 |
+
$html = "<span class='mega-toggle-label' role='button' aria-expanded='false'><span class='mega-toggle-label-closed'>{$closed_text}</span><span class='mega-toggle-label-open'>{$open_text}</span></span>";
|
71 |
} else {
|
72 |
$html = "";
|
73 |
}
|
241 |
|
242 |
$id = apply_filters('megamenu_toggle_block_id', 'mega-toggle-block-' . $block_id);
|
243 |
|
244 |
+
$atts = array(
|
245 |
"class" => "mega-toggle-block {$class} mega-toggle-block-{$block_id}",
|
246 |
+
"id" => "mega-toggle-block-{$block_id}",
|
247 |
+
);
|
248 |
+
|
249 |
+
if ( isset( $block['type'] ) && $block['type'] == 'menu_toggle' ) {
|
250 |
+
$atts['tabindex'] = '0';
|
251 |
+
}
|
252 |
+
|
253 |
+
$attributes = apply_filters('megamenu_toggle_block_attributes', $atts, $block, $content, $nav_menu, $args, $theme_id);
|
254 |
|
255 |
$block_html .= "<div";
|
256 |
|
467 |
$open_icon = 'disabled';
|
468 |
}
|
469 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
470 |
$styles = array(
|
471 |
'id' => $index,
|
472 |
'align' => isset($settings['align']) ? "'" . $settings['align'] . "'" : "'right'",
|
473 |
+
'closed_text' => "''", // deprecated
|
474 |
+
'open_text' => "''", // deprecated
|
475 |
'closed_icon' => $closed_icon != 'disabled' ? "'\\" . $closed_icon . "'" : "''",
|
476 |
'open_icon' => $open_icon != 'disabled' ? "'\\" . $open_icon . "'" : "''",
|
477 |
'text_color' => isset($settings['text_color']) ? $settings['text_color'] : '#fff',
|
857 |
*/
|
858 |
public function output_menu_public_toggle_block_animated_html( $html, $settings ) {
|
859 |
$style = isset( $settings['style'] ) ? $settings['style'] : "slider";
|
860 |
+
$label = isset( $settings['aria_label'] ) ? do_shortcode( stripslashes( $settings['aria_label'] ) ) : "Toggle Menu";
|
861 |
|
862 |
+
$html = '<button aria-label="'. esc_attr($label) .'" class="mega-toggle-animated mega-toggle-animated-' . esc_attr($style) . '" type="button" aria-expanded="false">
|
863 |
<span class="mega-toggle-animated-box">
|
864 |
<span class="mega-toggle-animated-inner"></span>
|
865 |
</span>
|
884 |
|
885 |
$defaults = array(
|
886 |
'icon_scale' => '0.8',
|
887 |
+
'icon_color' => 'rgb(221, 221, 221)',
|
888 |
+
'aria_label' => 'Toggle Menu'
|
889 |
);
|
890 |
|
891 |
$settings = array_merge( $defaults, $settings );
|
912 |
<option value='1.2' <?php selected( $settings['icon_scale'], "1.2" ) ?> ><?php _e("X Large", "megamenu") ?></option>
|
913 |
</select>
|
914 |
</label>
|
915 |
+
<label>
|
916 |
+
<?php _e("Label", "megamenu") ?><input type='text' class='aria_label' name='toggle_blocks[<?php echo $block_id; ?>][aria_label]' value='<?php echo stripslashes( esc_attr( $settings['aria_label'] ) ) ?>' />
|
917 |
+
</label>
|
918 |
<a class='mega-delete'><?php _e("Delete", "megamenu"); ?></a>
|
919 |
</div>
|
920 |
</div>
|
classes/walker.class.php
CHANGED
@@ -79,6 +79,9 @@ class Mega_Menu_Walker extends Walker_Nav_Menu {
|
|
79 |
|
80 |
$class = join( ' ', apply_filters( 'megamenu_nav_menu_css_class', array_filter( $classes ), $item, $args ) );
|
81 |
|
|
|
|
|
|
|
82 |
// strip widget classes back to how they're intended to be output
|
83 |
$class = str_replace( "mega-menu-widget-class-", "", $class );
|
84 |
|
@@ -122,17 +125,18 @@ class Mega_Menu_Walker extends Walker_Nav_Menu {
|
|
122 |
$atts['class'] = 'mega-custom-icon';
|
123 |
}
|
124 |
|
125 |
-
|
126 |
|
127 |
-
|
128 |
-
|
129 |
-
} else {
|
130 |
-
$atts['class'] = 'mega-menu-link';
|
131 |
-
}
|
132 |
|
133 |
-
|
134 |
-
|
135 |
-
|
|
|
|
|
|
|
|
|
136 |
}
|
137 |
|
138 |
if ( $depth == 0 ) {
|
@@ -143,6 +147,14 @@ class Mega_Menu_Walker extends Walker_Nav_Menu {
|
|
143 |
$atts['aria-label'] = $item->title;
|
144 |
}
|
145 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
$attributes = '';
|
147 |
|
148 |
foreach ( $atts as $attr => $value ) {
|
79 |
|
80 |
$class = join( ' ', apply_filters( 'megamenu_nav_menu_css_class', array_filter( $classes ), $item, $args ) );
|
81 |
|
82 |
+
// these classes are prepended with 'mega-'
|
83 |
+
$mega_classes = explode( ' ', $class);
|
84 |
+
|
85 |
// strip widget classes back to how they're intended to be output
|
86 |
$class = str_replace( "mega-menu-widget-class-", "", $class );
|
87 |
|
125 |
$atts['class'] = 'mega-custom-icon';
|
126 |
}
|
127 |
|
128 |
+
if ( in_array('menu-item-has-children', $classes ) && $item->parent_submenu_type == 'flyout') {
|
129 |
|
130 |
+
$atts['aria-haspopup'] = "true"; // required for Surface/Win10/Edge
|
131 |
+
$atts['aria-expanded'] = "false";
|
|
|
|
|
|
|
132 |
|
133 |
+
if ( in_array('mega-toggle-on', $mega_classes ) ) {
|
134 |
+
$atts['aria-expanded'] = "true";
|
135 |
+
}
|
136 |
+
|
137 |
+
if ( $settings['disable_link'] == 'true' ) {
|
138 |
+
$atts['role'] = 'button';
|
139 |
+
}
|
140 |
}
|
141 |
|
142 |
if ( $depth == 0 ) {
|
147 |
$atts['aria-label'] = $item->title;
|
148 |
}
|
149 |
|
150 |
+
$atts = apply_filters( 'megamenu_nav_menu_link_attributes', $atts, $item, $args );
|
151 |
+
|
152 |
+
if ( strlen( $atts['class'] ) ) {
|
153 |
+
$atts['class'] = $atts['class'] . ' mega-menu-link';
|
154 |
+
} else {
|
155 |
+
$atts['class'] = 'mega-menu-link';
|
156 |
+
}
|
157 |
+
|
158 |
$attributes = '';
|
159 |
|
160 |
foreach ( $atts as $attr => $value ) {
|
classes/widget-manager.class.php
CHANGED
@@ -15,6 +15,8 @@ if ( ! class_exists('Mega_Menu_Widget_Manager') ) :
|
|
15 |
*/
|
16 |
class Mega_Menu_Widget_Manager {
|
17 |
|
|
|
|
|
18 |
/**
|
19 |
* Constructor
|
20 |
*
|
@@ -39,6 +41,8 @@ class Mega_Menu_Widget_Manager {
|
|
39 |
add_action( 'megamenu_after_widget_save', array( $this, 'clear_caches' ) );
|
40 |
add_action( 'megamenu_after_widget_delete', array( $this, 'clear_caches' ) );
|
41 |
|
|
|
|
|
42 |
}
|
43 |
|
44 |
|
@@ -348,20 +352,22 @@ class Mega_Menu_Widget_Manager {
|
|
348 |
* @since 1.5
|
349 |
* @return array
|
350 |
*/
|
351 |
-
private function get_second_level_menu_items( $parent_menu_item_id, $menu_id ) {
|
352 |
|
353 |
-
$
|
354 |
|
355 |
// check we're using a valid menu ID
|
356 |
if ( ! is_nav_menu( $menu_id ) ) {
|
357 |
-
return $
|
358 |
}
|
359 |
|
360 |
-
|
|
|
|
|
361 |
|
362 |
-
if ( count( $
|
363 |
|
364 |
-
foreach ( $
|
365 |
|
366 |
// find the child menu items
|
367 |
if ( $item->menu_item_parent == $parent_menu_item_id ) {
|
@@ -370,7 +376,7 @@ class Mega_Menu_Widget_Manager {
|
|
370 |
|
371 |
$settings = array_merge( Mega_Menu_Nav_Menus::get_menu_item_defaults(), $saved_settings );
|
372 |
|
373 |
-
$
|
374 |
'id' => $item->ID,
|
375 |
'type' => 'menu_item',
|
376 |
'title' => $item->title,
|
@@ -384,7 +390,7 @@ class Mega_Menu_Widget_Manager {
|
|
384 |
|
385 |
}
|
386 |
|
387 |
-
return $
|
388 |
}
|
389 |
|
390 |
/**
|
@@ -397,9 +403,9 @@ class Mega_Menu_Widget_Manager {
|
|
397 |
|
398 |
$widgets = array();
|
399 |
|
400 |
-
if ( $
|
401 |
|
402 |
-
foreach ( $mega_menu_widgets as $widget_id ) {
|
403 |
|
404 |
$settings = $this->get_settings_for_widget_id( $widget_id );
|
405 |
|
@@ -476,18 +482,18 @@ class Mega_Menu_Widget_Manager {
|
|
476 |
* @since 2.4
|
477 |
* @return array
|
478 |
*/
|
479 |
-
public function get_grid_widgets_and_menu_items_for_menu_id( $parent_menu_item_id, $menu_id ) {
|
480 |
|
481 |
$meta = get_post_meta($parent_menu_item_id, '_megamenu', true);
|
482 |
|
483 |
$saved_grid = array();
|
484 |
|
485 |
if ( isset( $meta['grid'] ) ) {
|
486 |
-
$saved_grid = $this->populate_saved_grid_data( $parent_menu_item_id, $menu_id, $meta['grid'] );
|
487 |
} else {
|
488 |
// return empty row
|
489 |
$saved_grid[0]['columns'][0]['meta']['span'] = 3;
|
490 |
-
$saved_grid = $this->populate_saved_grid_data( $parent_menu_item_id, $menu_id, $saved_grid );
|
491 |
|
492 |
}
|
493 |
|
@@ -504,9 +510,9 @@ class Mega_Menu_Widget_Manager {
|
|
504 |
* @since 2.4
|
505 |
* @return array
|
506 |
*/
|
507 |
-
public function populate_saved_grid_data( $parent_menu_item_id, $menu_id, $saved_grid ) {
|
508 |
|
509 |
-
$second_level_menu_items = $this->get_second_level_menu_items( $parent_menu_item_id, $menu_id );
|
510 |
|
511 |
$menu_items_included = array();
|
512 |
|
@@ -1194,6 +1200,8 @@ class Mega_Menu_Widget_Manager {
|
|
1194 |
|
1195 |
wp_set_sidebars_widgets( $sidebar_widgets );
|
1196 |
|
|
|
|
|
1197 |
}
|
1198 |
|
1199 |
|
15 |
*/
|
16 |
class Mega_Menu_Widget_Manager {
|
17 |
|
18 |
+
var $mega_menu_widgets = false;
|
19 |
+
|
20 |
/**
|
21 |
* Constructor
|
22 |
*
|
41 |
add_action( 'megamenu_after_widget_save', array( $this, 'clear_caches' ) );
|
42 |
add_action( 'megamenu_after_widget_delete', array( $this, 'clear_caches' ) );
|
43 |
|
44 |
+
$this->mega_menu_widgets = $this->get_mega_menu_sidebar_widgets();
|
45 |
+
|
46 |
}
|
47 |
|
48 |
|
352 |
* @since 1.5
|
353 |
* @return array
|
354 |
*/
|
355 |
+
private function get_second_level_menu_items( $parent_menu_item_id, $menu_id, $menu_items = false ) {
|
356 |
|
357 |
+
$second_level_items = array();
|
358 |
|
359 |
// check we're using a valid menu ID
|
360 |
if ( ! is_nav_menu( $menu_id ) ) {
|
361 |
+
return $second_level_items;
|
362 |
}
|
363 |
|
364 |
+
if ( ! $menu_items ) {
|
365 |
+
$menu_items = wp_get_nav_menu_items( $menu_id );
|
366 |
+
}
|
367 |
|
368 |
+
if ( count( $menu_items ) ) {
|
369 |
|
370 |
+
foreach ( $menu_items as $item ) {
|
371 |
|
372 |
// find the child menu items
|
373 |
if ( $item->menu_item_parent == $parent_menu_item_id ) {
|
376 |
|
377 |
$settings = array_merge( Mega_Menu_Nav_Menus::get_menu_item_defaults(), $saved_settings );
|
378 |
|
379 |
+
$second_level_items[ $item->ID ] = array(
|
380 |
'id' => $item->ID,
|
381 |
'type' => 'menu_item',
|
382 |
'title' => $item->title,
|
390 |
|
391 |
}
|
392 |
|
393 |
+
return $second_level_items;
|
394 |
}
|
395 |
|
396 |
/**
|
403 |
|
404 |
$widgets = array();
|
405 |
|
406 |
+
if ( $this->mega_menu_widgets ) {
|
407 |
|
408 |
+
foreach ( $this->mega_menu_widgets as $widget_id ) {
|
409 |
|
410 |
$settings = $this->get_settings_for_widget_id( $widget_id );
|
411 |
|
482 |
* @since 2.4
|
483 |
* @return array
|
484 |
*/
|
485 |
+
public function get_grid_widgets_and_menu_items_for_menu_id( $parent_menu_item_id, $menu_id, $menu_items = false ) {
|
486 |
|
487 |
$meta = get_post_meta($parent_menu_item_id, '_megamenu', true);
|
488 |
|
489 |
$saved_grid = array();
|
490 |
|
491 |
if ( isset( $meta['grid'] ) ) {
|
492 |
+
$saved_grid = $this->populate_saved_grid_data( $parent_menu_item_id, $menu_id, $meta['grid'], $menu_items );
|
493 |
} else {
|
494 |
// return empty row
|
495 |
$saved_grid[0]['columns'][0]['meta']['span'] = 3;
|
496 |
+
$saved_grid = $this->populate_saved_grid_data( $parent_menu_item_id, $menu_id, $saved_grid, $menu_items );
|
497 |
|
498 |
}
|
499 |
|
510 |
* @since 2.4
|
511 |
* @return array
|
512 |
*/
|
513 |
+
public function populate_saved_grid_data( $parent_menu_item_id, $menu_id, $saved_grid, $menu_items ) {
|
514 |
|
515 |
+
$second_level_menu_items = $this->get_second_level_menu_items( $parent_menu_item_id, $menu_id, $menu_items );
|
516 |
|
517 |
$menu_items_included = array();
|
518 |
|
1200 |
|
1201 |
wp_set_sidebars_widgets( $sidebar_widgets );
|
1202 |
|
1203 |
+
$this->mega_menu_widgets = $this->get_mega_menu_sidebar_widgets();
|
1204 |
+
|
1205 |
}
|
1206 |
|
1207 |
|
css/admin/admin.css
CHANGED
@@ -1637,6 +1637,9 @@ body.toplevel_page_maxmegamenu .megamenu_right {
|
|
1637 |
height: auto;
|
1638 |
min-height: 150px;
|
1639 |
border: 1px solid #aaa; }
|
|
|
|
|
|
|
1640 |
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table .CodeMirror-scroll,
|
1641 |
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table .CodeMirror-scroll {
|
1642 |
min-height: 150px; }
|
@@ -1672,7 +1675,7 @@ body.toplevel_page_maxmegamenu .megamenu_right {
|
|
1672 |
display: block;
|
1673 |
float: left;
|
1674 |
font-size: 0.9em;
|
1675 |
-
color: #
|
1676 |
line-height: 20px;
|
1677 |
width: 100%; }
|
1678 |
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table td.mega-value .mega-info:before,
|
@@ -1867,7 +1870,7 @@ body.toplevel_page_maxmegamenu .megamenu_right {
|
|
1867 |
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table label span.mega-short-desc {
|
1868 |
font-size: 0.8em;
|
1869 |
text-transform: uppercase;
|
1870 |
-
color: #
|
1871 |
display: block;
|
1872 |
margin: 0 0 2px 1px; }
|
1873 |
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table label.mega-copy_color,
|
1637 |
height: auto;
|
1638 |
min-height: 150px;
|
1639 |
border: 1px solid #aaa; }
|
1640 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table div.CodeMirror span.CodeMirror-matchingbracket,
|
1641 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table div.CodeMirror span.CodeMirror-matchingbracket {
|
1642 |
+
color: green; }
|
1643 |
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table .CodeMirror-scroll,
|
1644 |
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table .CodeMirror-scroll {
|
1645 |
min-height: 150px; }
|
1675 |
display: block;
|
1676 |
float: left;
|
1677 |
font-size: 0.9em;
|
1678 |
+
color: #777;
|
1679 |
line-height: 20px;
|
1680 |
width: 100%; }
|
1681 |
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table td.mega-value .mega-info:before,
|
1870 |
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table label span.mega-short-desc {
|
1871 |
font-size: 0.8em;
|
1872 |
text-transform: uppercase;
|
1873 |
+
color: #777;
|
1874 |
display: block;
|
1875 |
margin: 0 0 2px 1px; }
|
1876 |
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table label.mega-copy_color,
|
css/admin/admin.scss
CHANGED
@@ -2151,6 +2151,10 @@ body.toplevel_page_maxmegamenu {
|
|
2151 |
border: 1px solid #aaa;
|
2152 |
}
|
2153 |
|
|
|
|
|
|
|
|
|
2154 |
.CodeMirror-scroll {
|
2155 |
min-height: 150px;
|
2156 |
}
|
@@ -2190,7 +2194,7 @@ body.toplevel_page_maxmegamenu {
|
|
2190 |
display: block;
|
2191 |
float: left;
|
2192 |
font-size: 0.9em;
|
2193 |
-
color: #
|
2194 |
line-height: 20px;
|
2195 |
width: 100%;
|
2196 |
|
@@ -2415,7 +2419,7 @@ body.toplevel_page_maxmegamenu {
|
|
2415 |
label span.mega-short-desc {
|
2416 |
font-size: 0.8em;
|
2417 |
text-transform: uppercase;
|
2418 |
-
color: #
|
2419 |
display: block;
|
2420 |
margin: 0 0 2px 1px;
|
2421 |
}
|
2151 |
border: 1px solid #aaa;
|
2152 |
}
|
2153 |
|
2154 |
+
div.CodeMirror span.CodeMirror-matchingbracket {
|
2155 |
+
color: green;
|
2156 |
+
}
|
2157 |
+
|
2158 |
.CodeMirror-scroll {
|
2159 |
min-height: 150px;
|
2160 |
}
|
2194 |
display: block;
|
2195 |
float: left;
|
2196 |
font-size: 0.9em;
|
2197 |
+
color: #777;
|
2198 |
line-height: 20px;
|
2199 |
width: 100%;
|
2200 |
|
2419 |
label span.mega-short-desc {
|
2420 |
font-size: 0.8em;
|
2421 |
text-transform: uppercase;
|
2422 |
+
color: #777;
|
2423 |
display: block;
|
2424 |
margin: 0 0 2px 1px;
|
2425 |
}
|
css/admin/global.css
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
@font-face {
|
2 |
-
font-family: 'maxmegamenu';
|
3 |
-
src: url('../../font/maxmegamenu.eot?82360077');
|
4 |
-
src: url('../../font/maxmegamenu.eot?82360077#iefix') format('embedded-opentype'),
|
5 |
-
url('../../font/maxmegamenu.woff2?82360077') format('woff2'),
|
6 |
-
url('../../font/maxmegamenu.woff?82360077') format('woff'),
|
7 |
-
url('../../font/maxmegamenu.ttf?82360077') format('truetype'),
|
8 |
-
url('../../font/maxmegamenu.svg?82360077#maxmegamenu') format('svg');
|
9 |
-
font-weight: normal;
|
10 |
-
font-style: normal;
|
11 |
-
}
|
12 |
-
|
13 |
-
#adminmenu .toplevel_page_maxmegamenu div.wp-menu-image:before {
|
14 |
-
content: "\e802" !important;
|
15 |
-
font-family: "maxmegamenu" !important;
|
16 |
-
speak: none;
|
17 |
-
font-size: 19px;
|
18 |
-
margin-left: 1px;
|
19 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/megamenu.scss
CHANGED
@@ -46,6 +46,7 @@
|
|
46 |
right: auto;
|
47 |
text-align: left;
|
48 |
text-decoration: none;
|
|
|
49 |
text-transform: none;
|
50 |
transform: none;
|
51 |
top: auto;
|
@@ -69,9 +70,19 @@
|
|
69 |
|
70 |
&.mega-keyboard-navigation {
|
71 |
.mega-menu-toggle:focus,
|
|
|
|
|
|
|
|
|
72 |
#{$menu} a:focus,
|
73 |
-
#{$menu} input:focus
|
74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
}
|
76 |
|
77 |
> li.mega-menu-item > a.mega-menu-link:focus {
|
@@ -122,6 +133,19 @@
|
|
122 |
}
|
123 |
}
|
124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
|
126 |
li.mega-menu-item.mega-icon-top > a.mega-menu-link {
|
127 |
display: table-cell;
|
@@ -189,6 +213,23 @@
|
|
189 |
pointer-events: auto;
|
190 |
}
|
191 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
@include desktop {
|
193 |
&[data-effect="fade"] {
|
194 |
li.mega-menu-item > ul.mega-sub-menu {
|
@@ -624,6 +665,10 @@
|
|
624 |
vertical-align: top;
|
625 |
display: block;
|
626 |
}
|
|
|
|
|
|
|
|
|
627 |
}
|
628 |
|
629 |
// Third level menu items hover
|
@@ -659,7 +704,8 @@
|
|
659 |
}
|
660 |
|
661 |
> li.mega-menu-megamenu.mega-no-headers > ul.mega-sub-menu {
|
662 |
-
> li.mega-menu-item > a.mega-menu-link
|
|
|
663 |
color: $panel_third_level_font_color;
|
664 |
font-family: $panel_third_level_font;
|
665 |
font-size: $panel_third_level_font_size;
|
@@ -674,7 +720,9 @@
|
|
674 |
}
|
675 |
|
676 |
> li.mega-menu-item > a.mega-menu-link:hover,
|
677 |
-
> li.mega-menu-item > a.mega-menu-link:focus
|
|
|
|
|
678 |
color: $panel_third_level_font_color_hover;
|
679 |
font-weight: $panel_third_level_font_weight_hover;
|
680 |
text-decoration: $panel_third_level_text_decoration_hover;
|
@@ -846,21 +894,25 @@
|
|
846 |
}
|
847 |
|
848 |
@include mobile {
|
849 |
-
a.mega-menu-link
|
850 |
-
float: right;
|
851 |
-
}
|
852 |
-
|
853 |
-
&.mega-toggle-on > a.mega-menu-link {
|
854 |
&:after {
|
855 |
display: none;
|
856 |
}
|
857 |
|
858 |
> span.mega-indicator {
|
859 |
display: inline-block;
|
|
|
|
|
|
|
|
|
860 |
}
|
861 |
}
|
862 |
|
863 |
-
&.mega-
|
|
|
|
|
|
|
|
|
864 |
display: none;
|
865 |
}
|
866 |
}
|
@@ -868,6 +920,7 @@
|
|
868 |
|
869 |
// Hide arrows
|
870 |
li.mega-menu-megamenu:not(.mega-menu-tabbed) li.mega-menu-item-has-children > a.mega-menu-link:after,
|
|
|
871 |
li.mega-menu-item-has-children.mega-hide-arrow > a.mega-menu-link:after {
|
872 |
display: none;
|
873 |
}
|
@@ -959,7 +1012,7 @@
|
|
959 |
clear: both;
|
960 |
}
|
961 |
|
962 |
-
@if $disable_mobile_toggle == off and $mobile_menu_overlay == on {
|
963 |
#{$menu} {
|
964 |
position: absolute;
|
965 |
width: 100%;
|
@@ -1065,6 +1118,7 @@
|
|
1065 |
display: -webkit-flex;
|
1066 |
display: flex;
|
1067 |
height: 100%;
|
|
|
1068 |
|
1069 |
-webkit-align-self: center;
|
1070 |
-ms-flex-item-align: center;
|
@@ -1085,17 +1139,6 @@
|
|
1085 |
} @else {
|
1086 |
display: none;
|
1087 |
}
|
1088 |
-
|
1089 |
-
li.mega-menu-item > ul.mega-sub-menu {
|
1090 |
-
display: none;
|
1091 |
-
visibility: visible;
|
1092 |
-
opacity: 1;
|
1093 |
-
}
|
1094 |
-
|
1095 |
-
li.mega-menu-item.mega-toggle-on > ul.mega-sub-menu,
|
1096 |
-
li.mega-menu-megamenu.mega-menu-item.mega-toggle-on ul.mega-sub-menu {
|
1097 |
-
display: block;
|
1098 |
-
}
|
1099 |
}
|
1100 |
|
1101 |
&.mega-menu-open + #{$menu} {
|
46 |
right: auto;
|
47 |
text-align: left;
|
48 |
text-decoration: none;
|
49 |
+
text-indent: 0;
|
50 |
text-transform: none;
|
51 |
transform: none;
|
52 |
top: auto;
|
70 |
|
71 |
&.mega-keyboard-navigation {
|
72 |
.mega-menu-toggle:focus,
|
73 |
+
.mega-toggle-block:focus,
|
74 |
+
.mega-toggle-block a:focus,
|
75 |
+
.mega-toggle-block .mega-search input[type=text]:focus,
|
76 |
+
.mega-toggle-block button.mega-toggle-animated:focus,
|
77 |
#{$menu} a:focus,
|
78 |
+
#{$menu} input:focus,
|
79 |
+
#{$menu} li.mega-menu-item a.mega-menu-link:focus {
|
80 |
+
outline: 3px solid #109cde;
|
81 |
+
outline-offset: -3px;
|
82 |
+
}
|
83 |
+
|
84 |
+
.mega-toggle-block button.mega-toggle-animated:focus {
|
85 |
+
outline-offset: 2px;
|
86 |
}
|
87 |
|
88 |
> li.mega-menu-item > a.mega-menu-link:focus {
|
133 |
}
|
134 |
}
|
135 |
|
136 |
+
li.mega-menu-megamenu li.mega-menu-item.mega-icon-left.mega-has-description.mega-has-icon > a.mega-menu-link {
|
137 |
+
display: flex;
|
138 |
+
align-items: center;
|
139 |
+
|
140 |
+
&:before {
|
141 |
+
flex: 0 0 auto;
|
142 |
+
align-self: flex-start;
|
143 |
+
}
|
144 |
+
}
|
145 |
+
|
146 |
+
li.mega-menu-tabbed.mega-menu-megamenu > ul.mega-sub-menu > li.mega-menu-item.mega-icon-left.mega-has-description.mega-has-icon > a.mega-menu-link {
|
147 |
+
display: block;
|
148 |
+
}
|
149 |
|
150 |
li.mega-menu-item.mega-icon-top > a.mega-menu-link {
|
151 |
display: table-cell;
|
213 |
pointer-events: auto;
|
214 |
}
|
215 |
|
216 |
+
@include mobile {
|
217 |
+
li.mega-menu-item > ul.mega-sub-menu {
|
218 |
+
display: none;
|
219 |
+
visibility: visible;
|
220 |
+
opacity: 1;
|
221 |
+
}
|
222 |
+
|
223 |
+
li.mega-menu-item.mega-toggle-on > ul.mega-sub-menu,
|
224 |
+
li.mega-menu-megamenu.mega-menu-item.mega-toggle-on ul.mega-sub-menu {
|
225 |
+
display: block;
|
226 |
+
}
|
227 |
+
li.mega-menu-megamenu.mega-menu-item.mega-toggle-on li.mega-hide-sub-menu-on-mobile > ul.mega-sub-menu,
|
228 |
+
li.mega-hide-sub-menu-on-mobile > ul.mega-sub-menu {
|
229 |
+
display: none;
|
230 |
+
}
|
231 |
+
}
|
232 |
+
|
233 |
@include desktop {
|
234 |
&[data-effect="fade"] {
|
235 |
li.mega-menu-item > ul.mega-sub-menu {
|
665 |
vertical-align: top;
|
666 |
display: block;
|
667 |
}
|
668 |
+
|
669 |
+
&.mega-icon-left.mega-has-description.mega-has-icon > a.mega-menu-link {
|
670 |
+
display: flex;
|
671 |
+
}
|
672 |
}
|
673 |
|
674 |
// Third level menu items hover
|
704 |
}
|
705 |
|
706 |
> li.mega-menu-megamenu.mega-no-headers > ul.mega-sub-menu {
|
707 |
+
> li.mega-menu-item > a.mega-menu-link,
|
708 |
+
li.mega-menu-column > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link {
|
709 |
color: $panel_third_level_font_color;
|
710 |
font-family: $panel_third_level_font;
|
711 |
font-size: $panel_third_level_font_size;
|
720 |
}
|
721 |
|
722 |
> li.mega-menu-item > a.mega-menu-link:hover,
|
723 |
+
> li.mega-menu-item > a.mega-menu-link:focus,
|
724 |
+
li.mega-menu-column > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link:hover,
|
725 |
+
li.mega-menu-column > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link:focus {
|
726 |
color: $panel_third_level_font_color_hover;
|
727 |
font-weight: $panel_third_level_font_weight_hover;
|
728 |
text-decoration: $panel_third_level_text_decoration_hover;
|
894 |
}
|
895 |
|
896 |
@include mobile {
|
897 |
+
> a.mega-menu-link {
|
|
|
|
|
|
|
|
|
898 |
&:after {
|
899 |
display: none;
|
900 |
}
|
901 |
|
902 |
> span.mega-indicator {
|
903 |
display: inline-block;
|
904 |
+
|
905 |
+
&:after {
|
906 |
+
content: $arrow_down;
|
907 |
+
}
|
908 |
}
|
909 |
}
|
910 |
|
911 |
+
&.mega-toggle-on > a.mega-menu-link > span.mega-indicator:after {
|
912 |
+
content: $arrow_up;
|
913 |
+
}
|
914 |
+
|
915 |
+
&.mega-hide-sub-menu-on-mobile > a.mega-menu-link > span.mega-indicator {
|
916 |
display: none;
|
917 |
}
|
918 |
}
|
920 |
|
921 |
// Hide arrows
|
922 |
li.mega-menu-megamenu:not(.mega-menu-tabbed) li.mega-menu-item-has-children > a.mega-menu-link:after,
|
923 |
+
li.mega-menu-megamenu:not(.mega-menu-tabbed) li.mega-menu-item-has-children > a.mega-menu-link > span.mega-indicator,
|
924 |
li.mega-menu-item-has-children.mega-hide-arrow > a.mega-menu-link:after {
|
925 |
display: none;
|
926 |
}
|
1012 |
clear: both;
|
1013 |
}
|
1014 |
|
1015 |
+
@if ($disable_mobile_toggle == off and $mobile_menu_overlay == on) or ($disable_mobile_toggle == off and $mobile_menu_force_width == on) {
|
1016 |
#{$menu} {
|
1017 |
position: absolute;
|
1018 |
width: 100%;
|
1118 |
display: -webkit-flex;
|
1119 |
display: flex;
|
1120 |
height: 100%;
|
1121 |
+
outline: 0;
|
1122 |
|
1123 |
-webkit-align-self: center;
|
1124 |
-ms-flex-item-align: center;
|
1139 |
} @else {
|
1140 |
display: none;
|
1141 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1142 |
}
|
1143 |
|
1144 |
&.mega-menu-open + #{$menu} {
|
css/toggle-blocks.scss
CHANGED
@@ -126,12 +126,14 @@
|
|
126 |
transform: scale($scale);
|
127 |
align-self: center;
|
128 |
outline: 0;
|
|
|
129 |
}
|
130 |
.mega-toggle-animated-box {
|
131 |
width: 40px;
|
132 |
height: 24px;
|
133 |
display: inline-block;
|
134 |
position: relative;
|
|
|
135 |
}
|
136 |
.mega-toggle-animated-inner {
|
137 |
display: block;
|
126 |
transform: scale($scale);
|
127 |
align-self: center;
|
128 |
outline: 0;
|
129 |
+
background: none;
|
130 |
}
|
131 |
.mega-toggle-animated-box {
|
132 |
width: 40px;
|
133 |
height: 24px;
|
134 |
display: inline-block;
|
135 |
position: relative;
|
136 |
+
outline: 0;
|
137 |
}
|
138 |
.mega-toggle-animated-inner {
|
139 |
display: block;
|
font/maxmegamenu.eot
DELETED
Binary file
|
font/maxmegamenu.svg
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?xml version="1.0" standalone="no"?>
|
2 |
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3 |
-
<svg xmlns="http://www.w3.org/2000/svg">
|
4 |
-
<metadata>Copyright (C) 2016 by original authors @ fontello.com</metadata>
|
5 |
-
<defs>
|
6 |
-
<font id="maxmegamenu" horiz-adv-x="1000" >
|
7 |
-
<font-face font-family="maxmegamenu" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
|
8 |
-
<missing-glyph horiz-adv-x="1000" />
|
9 |
-
<glyph glyph-name="max-mega-menu---logo-concepts---con-2-3_white-icon-l" unicode="" d="M253 318c-4 3-10 0-10-6l-1-231-116 67c-11 6-17 18-17 30l0 333c1 13 13 22 25 19l-121 70c-8-14-13-31-13-48v-404c0-34 18-66 48-83l350-202c15-9 31-13 48-13v118c-4-1-9 1-13 3l-85 49v114l85-49c4-3 8-4 13-4v130c-4 0-9 1-13 3l-180 104z m626 282l0 0c0 0 0 0 0 0l-120-70c11 3 24-6 24-19l1-333c0-12-7-24-17-30l-117-67-1 231c0 6-5 9-10 6l-180-104c-4-2-8-3-13-3v-130c5 0 9 1 13 4l86 49v-114l-86-49c-4-2-8-4-13-3v-118c17 0 33 4 48 13l350 202c30 17 48 49 48 83v404c0 17-5 34-13 48z m-35 35l-350 202c-30 17-67 17-96 0l-350-202c-15-8-27-21-35-35l121-70 0 0c2-1 3-1 5-2l292-169c9-5 21-5 30 0l292 169c2 1 4 2 6 2l120 70c-8 14-20 27-35 35z m-193-33l-192-112c-8-4-17-4-24 0l-195 112c-5 4-5 12 0 15l194 113c7 3 15 3 22 0l195-113c6-3 6-11 0-15z" horiz-adv-x="892" />
|
10 |
-
</font>
|
11 |
-
</defs>
|
12 |
-
</svg>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
font/maxmegamenu.ttf
DELETED
Binary file
|
font/maxmegamenu.woff
DELETED
Binary file
|
font/maxmegamenu.woff2
DELETED
Binary file
|
js/admin.js
CHANGED
@@ -461,6 +461,10 @@
|
|
461 |
|
462 |
setTimeout(function(){
|
463 |
$(document).trigger("widget-added", [widget]);
|
|
|
|
|
|
|
|
|
464 |
}, 100);
|
465 |
|
466 |
});
|
@@ -1051,8 +1055,14 @@
|
|
1051 |
|
1052 |
setTimeout(function(){
|
1053 |
$(document).trigger("widget-added", [widget]);
|
|
|
|
|
|
|
|
|
|
|
1054 |
}, 100);
|
1055 |
|
|
|
1056 |
});
|
1057 |
|
1058 |
} else {
|
461 |
|
462 |
setTimeout(function(){
|
463 |
$(document).trigger("widget-added", [widget]);
|
464 |
+
|
465 |
+
if ('acf' in window) {
|
466 |
+
acf.getFields(document);
|
467 |
+
}
|
468 |
}, 100);
|
469 |
|
470 |
});
|
1055 |
|
1056 |
setTimeout(function(){
|
1057 |
$(document).trigger("widget-added", [widget]);
|
1058 |
+
|
1059 |
+
if ('acf' in window) {
|
1060 |
+
acf.getFields(document);
|
1061 |
+
}
|
1062 |
+
|
1063 |
}, 100);
|
1064 |
|
1065 |
+
|
1066 |
});
|
1067 |
|
1068 |
} else {
|
js/maxmegamenu.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
/*jslint browser: true, white: true, this: true */
|
2 |
/*global console,jQuery,megamenu,window,navigator*/
|
3 |
|
4 |
/*! Max Mega Menu jQuery Plugin */
|
5 |
-
(function($) {
|
6 |
"use strict";
|
7 |
|
8 |
$.maxmegamenu = function(menu, options) {
|
@@ -37,10 +37,12 @@
|
|
37 |
|
38 |
anchor.parent().triggerHandler("before_close_panel");
|
39 |
|
40 |
-
|
|
|
|
|
41 |
var speed = plugin.isMobileView() ? plugin.settings.effect_speed_mobile : plugin.settings.effect_speed;
|
42 |
|
43 |
-
anchor.siblings(".mega-sub-menu").animate({
|
44 |
anchor.siblings(".mega-sub-menu").css("display", "");
|
45 |
anchor.parent().removeClass("mega-toggle-on").triggerHandler("close_panel");
|
46 |
});
|
@@ -55,7 +57,7 @@
|
|
55 |
}
|
56 |
|
57 |
// pause video widget videos
|
58 |
-
anchor.siblings(".mega-sub-menu").find(
|
59 |
this.player.pause();
|
60 |
});
|
61 |
|
@@ -102,6 +104,8 @@
|
|
102 |
plugin.showPanel = function(anchor) {
|
103 |
anchor.parent().triggerHandler("before_open_panel");
|
104 |
|
|
|
|
|
105 |
$(".mega-animating").removeClass("mega-animating");
|
106 |
|
107 |
if (plugin.isMobileView() && anchor.parent().hasClass("mega-hide-sub-menu-on-mobile")) {
|
@@ -119,10 +123,10 @@
|
|
119 |
plugin.calculateDynamicSubmenuWidths(anchor);
|
120 |
|
121 |
// apply jQuery transition (only if the effect is set to "slide", other transitions are CSS based)
|
122 |
-
if ( plugin.settings.effect
|
123 |
var speed = plugin.isMobileView() ? plugin.settings.effect_speed_mobile : plugin.settings.effect_speed;
|
124 |
|
125 |
-
anchor.siblings(".mega-sub-menu").css("display", "none").animate({
|
126 |
$(this).css("display", "");
|
127 |
});
|
128 |
}
|
@@ -175,7 +179,7 @@
|
|
175 |
});
|
176 |
}
|
177 |
}
|
178 |
-
}
|
179 |
|
180 |
var bindClickEvents = function() {
|
181 |
var dragging = false;
|
@@ -213,7 +217,7 @@
|
|
213 |
if (plugin.isMobileView() && $(this).parent().hasClass("mega-hide-sub-menu-on-mobile")) {
|
214 |
return; // allow all clicks on parent items when sub menu is hidden on mobile
|
215 |
}
|
216 |
-
if ((plugin.settings.second_click === "go" || $(this).parent().hasClass("mega-click-click-go")) && $(this).attr(
|
217 |
if (!$(this).parent().hasClass("mega-toggle-on")) {
|
218 |
e.preventDefault();
|
219 |
plugin.showPanel($(this));
|
@@ -267,42 +271,128 @@
|
|
267 |
var bindKeyboardEvents = function() {
|
268 |
var tab_key = 9;
|
269 |
var escape_key = 27;
|
|
|
|
|
|
|
|
|
270 |
|
271 |
-
$(
|
272 |
var keyCode = e.keyCode || e.which;
|
273 |
|
274 |
-
if (keyCode ===
|
275 |
-
$menu.parent().
|
276 |
-
plugin.hideAllPanels();
|
277 |
}
|
|
|
278 |
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
|
283 |
-
|
284 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
}
|
286 |
}
|
287 |
});
|
288 |
|
289 |
-
$menu.parent().on("keyup", function(e) {
|
290 |
var keyCode = e.keyCode || e.which;
|
291 |
var active_link = $(e.target);
|
292 |
|
293 |
-
if (keyCode === tab_key) {
|
294 |
-
|
295 |
-
|
296 |
-
if ( active_link.parent().is(items_with_submenus) ) {
|
297 |
plugin.showPanel(active_link);
|
298 |
} else {
|
299 |
-
|
|
|
|
|
300 |
}
|
|
|
301 |
|
302 |
-
|
303 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
304 |
}
|
305 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
306 |
});
|
307 |
};
|
308 |
|
@@ -319,7 +409,11 @@
|
|
319 |
};
|
320 |
|
321 |
plugin.unbindHoverIntentEvents = function() {
|
322 |
-
items_with_submenus.unbind("mouseenter mouseleave").removeProp(
|
|
|
|
|
|
|
|
|
323 |
};
|
324 |
|
325 |
plugin.unbindMegaMenuEvents = function() {
|
@@ -332,7 +426,8 @@
|
|
332 |
}
|
333 |
|
334 |
plugin.unbindClickEvents();
|
335 |
-
|
|
|
336 |
|
337 |
plugin.bindMegaMenuEvents = function() {
|
338 |
if (plugin.isDesktopView() && plugin.settings.event === "hover_intent") {
|
@@ -377,16 +472,16 @@
|
|
377 |
};
|
378 |
|
379 |
plugin.reverseRightAlignedItems = function() {
|
380 |
-
if ( ! $(
|
381 |
$menu.append($menu.children("li.mega-item-align-right").get().reverse());
|
382 |
}
|
383 |
};
|
384 |
|
385 |
plugin.addClearClassesToMobileItems = function() {
|
386 |
$(".mega-menu-row", $menu).each(function() {
|
387 |
-
$("> .mega-sub-menu > .mega-menu-column:not(.mega-hide-on-mobile)", $(this)).filter(":even").addClass(
|
388 |
});
|
389 |
-
}
|
390 |
|
391 |
plugin.switchToMobile = function() {
|
392 |
plugin.unbindMegaMenuEvents();
|
@@ -403,12 +498,12 @@
|
|
403 |
plugin.hideAllPanels();
|
404 |
|
405 |
$menu.css({
|
406 |
-
width:
|
407 |
-
left:
|
408 |
-
display:
|
409 |
});
|
410 |
|
411 |
-
$toggle_bar.removeClass(
|
412 |
};
|
413 |
|
414 |
plugin.initToggleBar = function() {
|
@@ -429,14 +524,16 @@
|
|
429 |
return;
|
430 |
}
|
431 |
|
432 |
-
$(
|
|
|
|
|
433 |
|
434 |
-
if (plugin.settings.effect_mobile
|
435 |
-
$menu.animate({
|
436 |
$menu.css({
|
437 |
-
width:
|
438 |
-
left:
|
439 |
-
display:
|
440 |
});
|
441 |
});
|
442 |
}
|
@@ -449,12 +546,14 @@
|
|
449 |
return;
|
450 |
}
|
451 |
|
452 |
-
$(
|
|
|
|
|
453 |
|
454 |
plugin.toggleBarForceWidth();
|
455 |
|
456 |
-
if (plugin.settings.effect_mobile
|
457 |
-
$menu.animate({
|
458 |
}
|
459 |
|
460 |
$toggle_bar.addClass("mega-menu-open");
|
@@ -479,14 +578,19 @@
|
|
479 |
|
480 |
plugin.initToggleBar();
|
481 |
|
482 |
-
if (plugin.settings.unbind_events
|
483 |
plugin.unbindAllEvents();
|
484 |
}
|
485 |
|
486 |
-
$("span.mega-indicator", $menu).on(
|
487 |
e.preventDefault();
|
488 |
e.stopPropagation();
|
489 |
-
|
|
|
|
|
|
|
|
|
|
|
490 |
});
|
491 |
|
492 |
$(window).on("load", function() {
|
@@ -511,6 +615,6 @@
|
|
511 |
};
|
512 |
|
513 |
$(function() {
|
514 |
-
$(
|
515 |
});
|
516 |
-
}
|
1 |
+
/*jslint browser: true, white: true, this: true, long: true */
|
2 |
/*global console,jQuery,megamenu,window,navigator*/
|
3 |
|
4 |
/*! Max Mega Menu jQuery Plugin */
|
5 |
+
(function ( $ ) {
|
6 |
"use strict";
|
7 |
|
8 |
$.maxmegamenu = function(menu, options) {
|
37 |
|
38 |
anchor.parent().triggerHandler("before_close_panel");
|
39 |
|
40 |
+
anchor.attr("aria-expanded", "false");
|
41 |
+
|
42 |
+
if ( (!immediate && plugin.settings.effect === "slide") || (plugin.isMobileView() && plugin.settings.effect_mobile === "slide") ) {
|
43 |
var speed = plugin.isMobileView() ? plugin.settings.effect_speed_mobile : plugin.settings.effect_speed;
|
44 |
|
45 |
+
anchor.siblings(".mega-sub-menu").animate({"height":"hide", "paddingTop":"hide", "paddingBottom":"hide", "minHeight":"hide"}, speed, function() {
|
46 |
anchor.siblings(".mega-sub-menu").css("display", "");
|
47 |
anchor.parent().removeClass("mega-toggle-on").triggerHandler("close_panel");
|
48 |
});
|
57 |
}
|
58 |
|
59 |
// pause video widget videos
|
60 |
+
anchor.siblings(".mega-sub-menu").find(".widget_media_video video").each(function() {
|
61 |
this.player.pause();
|
62 |
});
|
63 |
|
104 |
plugin.showPanel = function(anchor) {
|
105 |
anchor.parent().triggerHandler("before_open_panel");
|
106 |
|
107 |
+
anchor.attr("aria-expanded", "true");
|
108 |
+
|
109 |
$(".mega-animating").removeClass("mega-animating");
|
110 |
|
111 |
if (plugin.isMobileView() && anchor.parent().hasClass("mega-hide-sub-menu-on-mobile")) {
|
123 |
plugin.calculateDynamicSubmenuWidths(anchor);
|
124 |
|
125 |
// apply jQuery transition (only if the effect is set to "slide", other transitions are CSS based)
|
126 |
+
if ( plugin.settings.effect === "slide" || (plugin.isMobileView() && plugin.settings.effect_mobile === "slide")) {
|
127 |
var speed = plugin.isMobileView() ? plugin.settings.effect_speed_mobile : plugin.settings.effect_speed;
|
128 |
|
129 |
+
anchor.siblings(".mega-sub-menu").css("display", "none").animate({"height":"show", "paddingTop":"show", "paddingBottom":"show", "minHeight":"show"}, speed, function() {
|
130 |
$(this).css("display", "");
|
131 |
});
|
132 |
}
|
179 |
});
|
180 |
}
|
181 |
}
|
182 |
+
};
|
183 |
|
184 |
var bindClickEvents = function() {
|
185 |
var dragging = false;
|
217 |
if (plugin.isMobileView() && $(this).parent().hasClass("mega-hide-sub-menu-on-mobile")) {
|
218 |
return; // allow all clicks on parent items when sub menu is hidden on mobile
|
219 |
}
|
220 |
+
if ((plugin.settings.second_click === "go" || $(this).parent().hasClass("mega-click-click-go")) && $(this).attr("href") !== undefined) { // check for second click
|
221 |
if (!$(this).parent().hasClass("mega-toggle-on")) {
|
222 |
e.preventDefault();
|
223 |
plugin.showPanel($(this));
|
271 |
var bindKeyboardEvents = function() {
|
272 |
var tab_key = 9;
|
273 |
var escape_key = 27;
|
274 |
+
var enter_key = 13;
|
275 |
+
var left_arrow_key = 37;
|
276 |
+
var right_arrow_key = 39;
|
277 |
+
var space_key = 32;
|
278 |
|
279 |
+
$menu.parent().on("keyup.megamenu", function(e) {
|
280 |
var keyCode = e.keyCode || e.which;
|
281 |
|
282 |
+
if (keyCode === tab_key) {
|
283 |
+
$menu.parent().addClass("mega-keyboard-navigation");
|
|
|
284 |
}
|
285 |
+
});
|
286 |
|
287 |
+
$menu.parent().on("keydown.megamenu", function(e) {
|
288 |
+
var keyCode = e.keyCode || e.which;
|
289 |
+
var active_link = $(e.target);
|
290 |
|
291 |
+
if (keyCode === space_key && $menu.parent().hasClass("mega-keyboard-navigation") ) {
|
292 |
+
e.preventDefault();
|
293 |
+
|
294 |
+
// pressing space on a parent item will always toggle the sub menu
|
295 |
+
if ( active_link.parent().is(items_with_submenus) ) {
|
296 |
+
if ( active_link.parent().hasClass("mega-toggle-on") && ! active_link.parent().parent().parent().hasClass("mega-menu-tabbed") ) {
|
297 |
+
plugin.hidePanel(active_link);
|
298 |
+
} else {
|
299 |
+
plugin.showPanel(active_link);
|
300 |
+
}
|
301 |
}
|
302 |
}
|
303 |
});
|
304 |
|
305 |
+
$menu.parent().on("keyup.megamenu", function(e) {
|
306 |
var keyCode = e.keyCode || e.which;
|
307 |
var active_link = $(e.target);
|
308 |
|
309 |
+
if ( keyCode === tab_key && $menu.parent().hasClass("mega-keyboard-navigation") ) {
|
310 |
+
if ( active_link.parent().is(items_with_submenus) && active_link.is("[href]") !== false ) {
|
|
|
|
|
311 |
plugin.showPanel(active_link);
|
312 |
} else {
|
313 |
+
if ( ! active_link.parent().parent().parent().hasClass("mega-menu-tabbed") ) {
|
314 |
+
plugin.hideSiblingPanels(active_link);
|
315 |
+
}
|
316 |
}
|
317 |
+
}
|
318 |
|
319 |
+
if ( keyCode === escape_key && $menu.parent().hasClass("mega-keyboard-navigation") ) {
|
320 |
+
var submenu_open = $("> .mega-toggle-on", $menu).length !== 0;
|
321 |
+
|
322 |
+
$("> .mega-toggle-on > a.mega-menu-link", $menu).focus();
|
323 |
+
|
324 |
+
plugin.hideAllPanels();
|
325 |
+
|
326 |
+
if ( plugin.isMobileView() && ! submenu_open ) {
|
327 |
+
plugin.hideMobileMenu();
|
328 |
+
$(".mega-menu-toggle-block, button.mega-toggle-animated", $toggle_bar).first().focus();
|
329 |
}
|
330 |
}
|
331 |
+
|
332 |
+
if ( keyCode === enter_key && $menu.parent().hasClass("mega-keyboard-navigation") ) {
|
333 |
+
if ( active_link.hasClass("mega-menu-toggle-block") ) {
|
334 |
+
if ( $toggle_bar.hasClass("mega-menu-open") ) {
|
335 |
+
plugin.hideMobileMenu();
|
336 |
+
} else {
|
337 |
+
plugin.showMobileMenu();
|
338 |
+
}
|
339 |
+
}
|
340 |
+
|
341 |
+
// pressing enter on a parent item without a link will toggle the sub menu
|
342 |
+
if ( active_link.parent().is(items_with_submenus) && active_link.is("[href]") === false ) {
|
343 |
+
if ( active_link.parent().hasClass("mega-toggle-on") && ! active_link.parent().parent().parent().hasClass("mega-menu-tabbed") ) {
|
344 |
+
plugin.hidePanel(active_link);
|
345 |
+
} else {
|
346 |
+
plugin.showPanel(active_link);
|
347 |
+
}
|
348 |
+
}
|
349 |
+
}
|
350 |
+
|
351 |
+
if ( keyCode === right_arrow_key && plugin.isDesktopView() && $menu.parent().hasClass("mega-keyboard-navigation") && $menu.hasClass("mega-menu-horizontal") ) {
|
352 |
+
var next_top_level_item = $("> .mega-toggle-on", $menu).nextAll("li.mega-menu-item:visible").find("> a.mega-menu-link, .mega-search input[type=text]").first();
|
353 |
+
|
354 |
+
if (next_top_level_item.length === 0) {
|
355 |
+
next_top_level_item = $(":focus", $menu).parent().nextAll("li.mega-menu-item:visible").find("> a.mega-menu-link, .mega-search input[type=text]").first();
|
356 |
+
}
|
357 |
+
|
358 |
+
next_top_level_item.focus();
|
359 |
+
|
360 |
+
if ( next_top_level_item.parent().is(items_with_submenus) && next_top_level_item.is("[href]") !== false ) {
|
361 |
+
plugin.showPanel(next_top_level_item);
|
362 |
+
} else {
|
363 |
+
plugin.hideSiblingPanels(next_top_level_item);
|
364 |
+
}
|
365 |
+
}
|
366 |
+
|
367 |
+
if ( keyCode === left_arrow_key && plugin.isDesktopView() && $menu.parent().hasClass("mega-keyboard-navigation") && $menu.hasClass("mega-menu-horizontal") ) {
|
368 |
+
var prev_top_level_item = $("> .mega-toggle-on", $menu).prevAll("li.mega-menu-item:visible").find("> a.mega-menu-link, .mega-search input[type=text]").last();
|
369 |
+
|
370 |
+
if (prev_top_level_item.length === 0) {
|
371 |
+
prev_top_level_item = $(":focus", $menu).parent().prevAll("li.mega-menu-item:visible").find("> a.mega-menu-link, .mega-search input[type=text]").last();
|
372 |
+
}
|
373 |
+
|
374 |
+
prev_top_level_item.focus();
|
375 |
+
|
376 |
+
if ( prev_top_level_item.parent().is(items_with_submenus) && prev_top_level_item.is("[href]") !== false ) {
|
377 |
+
plugin.showPanel(prev_top_level_item);
|
378 |
+
} else {
|
379 |
+
plugin.hideSiblingPanels(prev_top_level_item);
|
380 |
+
}
|
381 |
+
}
|
382 |
+
|
383 |
+
});
|
384 |
+
|
385 |
+
$menu.parent().on("focusout.megamenu", function(e) {
|
386 |
+
if ( $menu.parent().hasClass("mega-keyboard-navigation") ) {
|
387 |
+
setTimeout(function() {
|
388 |
+
var menu_has_focus = $menu.parent().find(":focus").length > 0;
|
389 |
+
if (! menu_has_focus) {
|
390 |
+
$menu.parent().removeClass("mega-keyboard-navigation");
|
391 |
+
plugin.hideAllPanels();
|
392 |
+
plugin.hideMobileMenu();
|
393 |
+
}
|
394 |
+
}, 10);
|
395 |
+
}
|
396 |
});
|
397 |
};
|
398 |
|
409 |
};
|
410 |
|
411 |
plugin.unbindHoverIntentEvents = function() {
|
412 |
+
items_with_submenus.unbind("mouseenter mouseleave").removeProp("hoverIntent_t").removeProp("hoverIntent_s"); // hoverintent does not allow namespaced events
|
413 |
+
};
|
414 |
+
|
415 |
+
plugin.unbindKeyboardEvents = function() {
|
416 |
+
$menu.parent().off("keyup.megamenu keydown.megamenu focusout.megamenu");
|
417 |
};
|
418 |
|
419 |
plugin.unbindMegaMenuEvents = function() {
|
426 |
}
|
427 |
|
428 |
plugin.unbindClickEvents();
|
429 |
+
plugin.unbindKeyboardEvents();
|
430 |
+
};
|
431 |
|
432 |
plugin.bindMegaMenuEvents = function() {
|
433 |
if (plugin.isDesktopView() && plugin.settings.event === "hover_intent") {
|
472 |
};
|
473 |
|
474 |
plugin.reverseRightAlignedItems = function() {
|
475 |
+
if ( ! $("body").hasClass("rtl") ) {
|
476 |
$menu.append($menu.children("li.mega-item-align-right").get().reverse());
|
477 |
}
|
478 |
};
|
479 |
|
480 |
plugin.addClearClassesToMobileItems = function() {
|
481 |
$(".mega-menu-row", $menu).each(function() {
|
482 |
+
$("> .mega-sub-menu > .mega-menu-column:not(.mega-hide-on-mobile)", $(this)).filter(":even").addClass("mega-menu-clear"); // :even is 0 based
|
483 |
});
|
484 |
+
};
|
485 |
|
486 |
plugin.switchToMobile = function() {
|
487 |
plugin.unbindMegaMenuEvents();
|
498 |
plugin.hideAllPanels();
|
499 |
|
500 |
$menu.css({
|
501 |
+
width: "",
|
502 |
+
left: "",
|
503 |
+
display: ""
|
504 |
});
|
505 |
|
506 |
+
$toggle_bar.removeClass("mega-menu-open");
|
507 |
};
|
508 |
|
509 |
plugin.initToggleBar = function() {
|
524 |
return;
|
525 |
}
|
526 |
|
527 |
+
$("body").removeClass($menu.attr("id") + "-mobile-open");
|
528 |
+
|
529 |
+
$(".mega-toggle-label, .mega-toggle-animated", $toggle_bar).attr("aria-expanded", "false");
|
530 |
|
531 |
+
if (plugin.settings.effect_mobile === "slide") {
|
532 |
+
$menu.animate({"height":"hide"}, plugin.settings.effect_speed_mobile, function() {
|
533 |
$menu.css({
|
534 |
+
width: "",
|
535 |
+
left: "",
|
536 |
+
display: ""
|
537 |
});
|
538 |
});
|
539 |
}
|
546 |
return;
|
547 |
}
|
548 |
|
549 |
+
$("body").addClass($menu.attr("id") + "-mobile-open");
|
550 |
+
|
551 |
+
$(".mega-toggle-label, .mega-toggle-animated", $toggle_bar).attr("aria-expanded", "true");
|
552 |
|
553 |
plugin.toggleBarForceWidth();
|
554 |
|
555 |
+
if (plugin.settings.effect_mobile === "slide") {
|
556 |
+
$menu.animate({"height":"show"}, plugin.settings.effect_speed_mobile);
|
557 |
}
|
558 |
|
559 |
$toggle_bar.addClass("mega-menu-open");
|
578 |
|
579 |
plugin.initToggleBar();
|
580 |
|
581 |
+
if (plugin.settings.unbind_events === "true") {
|
582 |
plugin.unbindAllEvents();
|
583 |
}
|
584 |
|
585 |
+
$("span.mega-indicator", $menu).on("click", function(e) {
|
586 |
e.preventDefault();
|
587 |
e.stopPropagation();
|
588 |
+
|
589 |
+
if ( $(this).parent().parent().hasClass("mega-toggle-on") ) {
|
590 |
+
plugin.hidePanel($(this).parent(), false);
|
591 |
+
} else {
|
592 |
+
plugin.showPanel($(this).parent(), false);
|
593 |
+
}
|
594 |
});
|
595 |
|
596 |
$(window).on("load", function() {
|
615 |
};
|
616 |
|
617 |
$(function() {
|
618 |
+
$(".max-mega-menu").maxmegamenu();
|
619 |
});
|
620 |
+
}( jQuery ));
|
js/settings.js
CHANGED
@@ -31,15 +31,7 @@ jQuery(function ($) {
|
|
31 |
});
|
32 |
|
33 |
if ($('#codemirror').length) {
|
34 |
-
|
35 |
-
tabMode: 'indent',
|
36 |
-
lineNumbers: true,
|
37 |
-
lineWrapping: true,
|
38 |
-
viewportMargin: Infinity,
|
39 |
-
onChange: function(cm) {
|
40 |
-
cm.save();
|
41 |
-
}
|
42 |
-
});
|
43 |
}
|
44 |
|
45 |
$('[data-tab="mega-tab-content-custom_styling"]').on('click', function() {
|
31 |
});
|
32 |
|
33 |
if ($('#codemirror').length) {
|
34 |
+
wp.codeEditor.initialize($('#codemirror'), cm_settings);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
|
37 |
$('[data-tab="mega-tab-content-custom_styling"]').on('click', function() {
|
megamenu.php
CHANGED
@@ -4,11 +4,21 @@
|
|
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.
|
8 |
* Author: megamenu.com
|
9 |
* Author URI: https://www.megamenu.com
|
10 |
* License: GPL-2.0+
|
11 |
-
* Copyright:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
|
14 |
if ( ! defined( 'ABSPATH' ) ) {
|
@@ -26,7 +36,7 @@ final class Mega_Menu {
|
|
26 |
/**
|
27 |
* @var string
|
28 |
*/
|
29 |
-
public $version = '2.
|
30 |
|
31 |
|
32 |
/**
|
@@ -132,8 +142,6 @@ final class Mega_Menu {
|
|
132 |
* @since 1.8.3
|
133 |
*/
|
134 |
public function admin_enqueue_scripts( $hook ) {
|
135 |
-
wp_enqueue_style( 'maxmegamenu-global', MEGAMENU_BASE_URL . 'css/admin/global.css', array(), MEGAMENU_VERSION );
|
136 |
-
|
137 |
if ( ! wp_script_is('maxmegamenu') ) {
|
138 |
if ( 'nav-menus.php' == $hook ) {
|
139 |
// load widget scripts and styles first to allow us to dequeue conflicting colorbox scripts from other plugins
|
@@ -442,6 +450,9 @@ final class Mega_Menu {
|
|
442 |
* @since 1.3
|
443 |
*/
|
444 |
public function add_responsive_toggle( $nav_menu, $args ) {
|
|
|
|
|
|
|
445 |
// make sure we're working with a Mega Menu
|
446 |
if ( ! is_a( $args->walker, 'Mega_Menu_Walker' ) )
|
447 |
return $nav_menu;
|
@@ -454,7 +465,7 @@ final class Mega_Menu {
|
|
454 |
|
455 |
$content = apply_filters( "megamenu_toggle_bar_content", $content, $nav_menu, $args, $theme_id );
|
456 |
|
457 |
-
$replace = $find . '<div class="mega-menu-toggle"
|
458 |
|
459 |
return str_replace( $find, $replace, $nav_menu );
|
460 |
}
|
@@ -470,6 +481,9 @@ final class Mega_Menu {
|
|
470 |
* @return array - Menu objects including widgets
|
471 |
*/
|
472 |
public function add_widgets_to_menu( $items, $args ) {
|
|
|
|
|
|
|
473 |
// make sure we're working with a Mega Menu
|
474 |
if ( ! is_a( $args->walker, 'Mega_Menu_Walker' ) ) {
|
475 |
return $items;
|
@@ -499,7 +513,7 @@ final class Mega_Menu {
|
|
499 |
|
500 |
$widget_position = 0;
|
501 |
$total_widgets_in_menu = count( $panel_widgets );
|
502 |
-
$next_order = $this->menu_order_of_next_sibling( $item->ID, $item->menu_item_parent,
|
503 |
|
504 |
if ( ! in_array( 'menu-item-has-children', $item->classes ) ) {
|
505 |
$item->classes[] = 'menu-item-has-children';
|
@@ -539,7 +553,7 @@ final class Mega_Menu {
|
|
539 |
// populate grid sub menus
|
540 |
if ( $item->depth === 0 && $item->megamenu_settings['type'] == 'grid' || ( $item->depth === 1 && $item->parent_submenu_type == 'tabbed' && $item->megamenu_settings['type'] == 'grid' ) ) {
|
541 |
|
542 |
-
$saved_grid = $widget_manager->get_grid_widgets_and_menu_items_for_menu_id( $item->ID, $args->menu->term_id );
|
543 |
|
544 |
$next_order = $this->menu_order_of_next_sibling( $item->ID, $item->menu_item_parent, $items) - 999;
|
545 |
|
@@ -801,7 +815,6 @@ final class Mega_Menu {
|
|
801 |
*/
|
802 |
public function reorder_menu_items_within_megamenus( $items, $args ) {
|
803 |
$new_items = array();
|
804 |
-
$wpml_lang_items = array();
|
805 |
|
806 |
// reorder menu items within mega menus based on internal ordering
|
807 |
foreach ( $items as $item ) {
|
@@ -816,15 +829,14 @@ final class Mega_Menu {
|
|
816 |
foreach ( $items as $item ) {
|
817 |
if ( in_array( 'wpml-ls-item', $item->classes ) ) {
|
818 |
$item->classes[] = 'menu-flyout';
|
819 |
-
$wpml_lang_items[] = $item;
|
820 |
-
} else {
|
821 |
-
$new_items[ $item->menu_order ] = $item;
|
822 |
}
|
|
|
|
|
823 |
}
|
824 |
|
825 |
ksort( $new_items );
|
826 |
|
827 |
-
return
|
828 |
}
|
829 |
|
830 |
|
@@ -884,7 +896,7 @@ final class Mega_Menu {
|
|
884 |
$item->classes[] = 'has-icon';
|
885 |
}
|
886 |
|
887 |
-
if ( $item->megamenu_settings['
|
888 |
$item->classes[] = "icon-" . $item->megamenu_settings['icon_position'];
|
889 |
}
|
890 |
|
@@ -978,6 +990,10 @@ final class Mega_Menu {
|
|
978 |
return $args;
|
979 |
}
|
980 |
|
|
|
|
|
|
|
|
|
981 |
$locations = get_nav_menu_locations();
|
982 |
|
983 |
if ( isset ( $settings[ $current_theme_location ]['enabled'] ) && $settings[ $current_theme_location ]['enabled'] == true ) {
|
@@ -1476,4 +1492,6 @@ if ( ! function_exists('max_mega_menu_get_active_caching_plugins') ) {
|
|
1476 |
|
1477 |
return $active_plugins;
|
1478 |
}
|
1479 |
-
}
|
|
|
|
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.6
|
8 |
* Author: megamenu.com
|
9 |
* Author URI: https://www.megamenu.com
|
10 |
* License: GPL-2.0+
|
11 |
+
* Copyright: 2019 Tom Hemsley (https://www.megamenu.com)
|
12 |
+
*
|
13 |
+
* Max Mega Menu is free software: you can redistribute it and/or modify
|
14 |
+
* it under the terms of the GNU General Public License as published by
|
15 |
+
* the Free Software Foundation, either version 2 of the License, or
|
16 |
+
* any later version.
|
17 |
+
*
|
18 |
+
* Max Mega Menu is distributed in the hope that it will be useful,
|
19 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
20 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
21 |
+
* GNU General Public License for more details.
|
22 |
*/
|
23 |
|
24 |
if ( ! defined( 'ABSPATH' ) ) {
|
36 |
/**
|
37 |
* @var string
|
38 |
*/
|
39 |
+
public $version = '2.6';
|
40 |
|
41 |
|
42 |
/**
|
142 |
* @since 1.8.3
|
143 |
*/
|
144 |
public function admin_enqueue_scripts( $hook ) {
|
|
|
|
|
145 |
if ( ! wp_script_is('maxmegamenu') ) {
|
146 |
if ( 'nav-menus.php' == $hook ) {
|
147 |
// load widget scripts and styles first to allow us to dequeue conflicting colorbox scripts from other plugins
|
450 |
* @since 1.3
|
451 |
*/
|
452 |
public function add_responsive_toggle( $nav_menu, $args ) {
|
453 |
+
|
454 |
+
$args = (object) $args;
|
455 |
+
|
456 |
// make sure we're working with a Mega Menu
|
457 |
if ( ! is_a( $args->walker, 'Mega_Menu_Walker' ) )
|
458 |
return $nav_menu;
|
465 |
|
466 |
$content = apply_filters( "megamenu_toggle_bar_content", $content, $nav_menu, $args, $theme_id );
|
467 |
|
468 |
+
$replace = $find . '<div class="mega-menu-toggle">' . $content . '</div>';
|
469 |
|
470 |
return str_replace( $find, $replace, $nav_menu );
|
471 |
}
|
481 |
* @return array - Menu objects including widgets
|
482 |
*/
|
483 |
public function add_widgets_to_menu( $items, $args ) {
|
484 |
+
|
485 |
+
$args = (object) $args;
|
486 |
+
|
487 |
// make sure we're working with a Mega Menu
|
488 |
if ( ! is_a( $args->walker, 'Mega_Menu_Walker' ) ) {
|
489 |
return $items;
|
513 |
|
514 |
$widget_position = 0;
|
515 |
$total_widgets_in_menu = count( $panel_widgets );
|
516 |
+
$next_order = $this->menu_order_of_next_sibling( $item->ID, $item->menu_item_parent, $items );
|
517 |
|
518 |
if ( ! in_array( 'menu-item-has-children', $item->classes ) ) {
|
519 |
$item->classes[] = 'menu-item-has-children';
|
553 |
// populate grid sub menus
|
554 |
if ( $item->depth === 0 && $item->megamenu_settings['type'] == 'grid' || ( $item->depth === 1 && $item->parent_submenu_type == 'tabbed' && $item->megamenu_settings['type'] == 'grid' ) ) {
|
555 |
|
556 |
+
$saved_grid = $widget_manager->get_grid_widgets_and_menu_items_for_menu_id( $item->ID, $args->menu->term_id, $items );
|
557 |
|
558 |
$next_order = $this->menu_order_of_next_sibling( $item->ID, $item->menu_item_parent, $items) - 999;
|
559 |
|
815 |
*/
|
816 |
public function reorder_menu_items_within_megamenus( $items, $args ) {
|
817 |
$new_items = array();
|
|
|
818 |
|
819 |
// reorder menu items within mega menus based on internal ordering
|
820 |
foreach ( $items as $item ) {
|
829 |
foreach ( $items as $item ) {
|
830 |
if ( in_array( 'wpml-ls-item', $item->classes ) ) {
|
831 |
$item->classes[] = 'menu-flyout';
|
|
|
|
|
|
|
832 |
}
|
833 |
+
|
834 |
+
$new_items[ $item->menu_order ] = $item;
|
835 |
}
|
836 |
|
837 |
ksort( $new_items );
|
838 |
|
839 |
+
return $new_items;
|
840 |
}
|
841 |
|
842 |
|
896 |
$item->classes[] = 'has-icon';
|
897 |
}
|
898 |
|
899 |
+
if ( $item->megamenu_settings['icon'] != 'disabled' && isset( $item->megamenu_settings['icon_position'] ) ) {
|
900 |
$item->classes[] = "icon-" . $item->megamenu_settings['icon_position'];
|
901 |
}
|
902 |
|
990 |
return $args;
|
991 |
}
|
992 |
|
993 |
+
if ( strlen( $active_instance ) && ! is_numeric( $active_instance ) && isset( $args['container_id'] ) && $active_instance != $args['container_id'] ) {
|
994 |
+
return $args;
|
995 |
+
}
|
996 |
+
|
997 |
$locations = get_nav_menu_locations();
|
998 |
|
999 |
if ( isset ( $settings[ $current_theme_location ]['enabled'] ) && $settings[ $current_theme_location ]['enabled'] == true ) {
|
1492 |
|
1493 |
return $active_plugins;
|
1494 |
}
|
1495 |
+
}
|
1496 |
+
|
1497 |
+
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== Max Mega Menu ===
|
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:
|
5 |
-
Tested up to: 5.
|
6 |
-
Stable tag: 2.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -109,6 +109,22 @@ See https://www.megamenu.com for more screenshots
|
|
109 |
|
110 |
== Changelog ==
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
= 2.5.3.2 =
|
113 |
|
114 |
* Fix: Dynamic Sub Menu Widths for tabbed sub menus
|
1 |
=== Max Mega Menu ===
|
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: 4.9
|
5 |
+
Tested up to: 5.2
|
6 |
+
Stable tag: 2.6
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
109 |
|
110 |
== Changelog ==
|
111 |
|
112 |
+
= 2.6 =
|
113 |
+
|
114 |
+
* Improvement: Use core version of CodeMirror (requires WordPress 4.9+)
|
115 |
+
* Improvement: Performance on grid layout sub menus
|
116 |
+
* Improvement: Accessibility - keyboard navigation and screen reader improvements
|
117 |
+
* Improvement: Allow a container_id to be specified as an Active Menu Instance
|
118 |
+
* Improvement: Swap out admin menu icon from font icon to SVG
|
119 |
+
* Fix: JS Lint JavaScript
|
120 |
+
* Fix: Compatiblity with ACF Pro Select2 fields
|
121 |
+
* Fix: WPML Language selector. Language selector position now respects the position set in the WPML options
|
122 |
+
* Fix: Apply 'no-headers' styling to grid layout sub menus
|
123 |
+
* Fix: 'Hide Sub Menu on mobile' option doesn't apply to mega menus
|
124 |
+
* Fix: Prevent CSS from being auto loaded
|
125 |
+
* Fix: Grid Layout: Title and descriprion are pushed below the icon when the description wraps onto two lines
|
126 |
+
* Change: Always show mega-indicator arrow on mobile (allows for unbinding events from the link itself)
|
127 |
+
|
128 |
= 2.5.3.2 =
|
129 |
|
130 |
* Fix: Dynamic Sub Menu Widths for tabbed sub menus
|