Version Description
[25/08/17] =
- Fix: Compatibility fix for Reamaze plugin
- Fix: Respect the 'Unbind JavaScript Events' setting on mobile menus
- Improvement: Add support for vh/vw units in theme editor
- Change: Don't close open sub menus when mobile toggle is clicked
Download this release
Release Info
Developer | megamenu |
Plugin | Max Mega Menu |
Version | 2.3.8 |
Comparing to | |
See all releases |
Code changes from version 2.3.7 to 2.3.8
- classes/nav-menus.class.php +11 -1
- css/megamenu.scss +6 -4
- js/maxmegamenu.js +31 -6
- js/settings.js +1 -1
- megamenu.php +2 -2
- readme.txt +12 -1
classes/nav-menus.class.php
CHANGED
@@ -71,7 +71,12 @@ class Mega_Menu_Nav_Menus {
|
|
71 |
*/
|
72 |
public function enable_site_origin_page_builder( $enabled ) {
|
73 |
$screen = get_current_screen();
|
74 |
-
|
|
|
|
|
|
|
|
|
|
|
75 |
}
|
76 |
|
77 |
/**
|
@@ -178,6 +183,11 @@ class Mega_Menu_Nav_Menus {
|
|
178 |
wp_deregister_script('color-box');
|
179 |
wp_deregister_style('color-box-css');
|
180 |
|
|
|
|
|
|
|
|
|
|
|
181 |
wp_enqueue_style( 'colorbox', MEGAMENU_BASE_URL . 'js/colorbox/colorbox.css', false, MEGAMENU_VERSION );
|
182 |
wp_enqueue_style( 'mega-menu', MEGAMENU_BASE_URL . 'css/admin/menus.css', false, MEGAMENU_VERSION );
|
183 |
|
71 |
*/
|
72 |
public function enable_site_origin_page_builder( $enabled ) {
|
73 |
$screen = get_current_screen();
|
74 |
+
|
75 |
+
if ($screen->base == 'nav-menus') {
|
76 |
+
return true;
|
77 |
+
}
|
78 |
+
|
79 |
+
return $enabled;
|
80 |
}
|
81 |
|
82 |
/**
|
183 |
wp_deregister_script('color-box');
|
184 |
wp_deregister_style('color-box-css');
|
185 |
|
186 |
+
// Compatibility fix for Reamaze
|
187 |
+
wp_deregister_script('jquery-colorbox');
|
188 |
+
wp_deregister_style('colorbox-css');
|
189 |
+
|
190 |
+
|
191 |
wp_enqueue_style( 'colorbox', MEGAMENU_BASE_URL . 'js/colorbox/colorbox.css', false, MEGAMENU_VERSION );
|
192 |
wp_enqueue_style( 'mega-menu', MEGAMENU_BASE_URL . 'css/admin/menus.css', false, MEGAMENU_VERSION );
|
193 |
|
css/megamenu.scss
CHANGED
@@ -850,10 +850,10 @@
|
|
850 |
outline: none;
|
851 |
|
852 |
@include mobile {
|
853 |
-
display: block;
|
854 |
-
|
855 |
@if $disable_mobile_toggle == on {
|
856 |
display: none;
|
|
|
|
|
857 |
}
|
858 |
}
|
859 |
|
@@ -879,12 +879,14 @@
|
|
879 |
margin-right: 6px;
|
880 |
}
|
881 |
|
|
|
882 |
@include mobile {
|
883 |
+ #{$menu} {
|
884 |
-
display: none;
|
885 |
|
886 |
@if $disable_mobile_toggle == on {
|
887 |
-
display: block;
|
|
|
|
|
888 |
}
|
889 |
|
890 |
li.mega-menu-item > ul.mega-sub-menu {
|
850 |
outline: none;
|
851 |
|
852 |
@include mobile {
|
|
|
|
|
853 |
@if $disable_mobile_toggle == on {
|
854 |
display: none;
|
855 |
+
} @else {
|
856 |
+
display: block;
|
857 |
}
|
858 |
}
|
859 |
|
879 |
margin-right: 6px;
|
880 |
}
|
881 |
|
882 |
+
|
883 |
@include mobile {
|
884 |
+ #{$menu} {
|
|
|
885 |
|
886 |
@if $disable_mobile_toggle == on {
|
887 |
+
display: block;
|
888 |
+
} @else {
|
889 |
+
display: none;
|
890 |
}
|
891 |
|
892 |
li.mega-menu-item > ul.mega-sub-menu {
|
js/maxmegamenu.js
CHANGED
@@ -170,13 +170,18 @@
|
|
170 |
});
|
171 |
|
172 |
$(document).on("click touchend", function(e) { // hide menu when clicked away from
|
173 |
-
if (!dragging && plugin.settings.document_click === "collapse" && ! $(e.target).closest(".mega-menu li").length ) {
|
174 |
plugin.hideAllPanels();
|
175 |
}
|
176 |
dragging = false;
|
177 |
});
|
178 |
|
179 |
$("> a.mega-menu-link", items_with_submenus).on("click.megamenu touchend.megamenu", function(e) {
|
|
|
|
|
|
|
|
|
|
|
180 |
if (plugin.isDesktopView() && $(this).parent().hasClass("mega-toggle-on") && $(this).parent().parent().parent().hasClass("mega-menu-tabbed")) {
|
181 |
e.preventDefault();
|
182 |
return;
|
@@ -206,13 +211,13 @@
|
|
206 |
|
207 |
var bindHoverEvents = function() {
|
208 |
items_with_submenus.on({
|
209 |
-
mouseenter: function() {
|
210 |
plugin.unbindClickEvents();
|
211 |
if (! $(this).hasClass("mega-toggle-on")) {
|
212 |
plugin.showPanel($(this).children("a.mega-menu-link"));
|
213 |
}
|
214 |
},
|
215 |
-
mouseleave: function() {
|
216 |
if ($(this).hasClass("mega-toggle-on") && ! $(this).parent().parent().hasClass("mega-menu-tabbed")) {
|
217 |
plugin.hidePanel($(this).children("a.mega-menu-link"), false);
|
218 |
}
|
@@ -281,9 +286,29 @@
|
|
281 |
};
|
282 |
|
283 |
plugin.unbindClickEvents = function() {
|
284 |
-
$("a.mega-menu-link",
|
|
|
|
|
|
|
|
|
285 |
};
|
286 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
287 |
plugin.bindMegaMenuEvents = function() {
|
288 |
if (plugin.isDesktopView() && plugin.settings.event === "hover_intent") {
|
289 |
bindHoverIntentEvents();
|
@@ -335,14 +360,14 @@
|
|
335 |
};
|
336 |
|
337 |
plugin.switchToMobile = function() {
|
338 |
-
plugin.
|
339 |
plugin.bindMegaMenuEvents();
|
340 |
plugin.reverseRightAlignedItems();
|
341 |
plugin.hideAllPanels();
|
342 |
};
|
343 |
|
344 |
plugin.switchToDesktop = function() {
|
345 |
-
plugin.
|
346 |
plugin.bindMegaMenuEvents();
|
347 |
plugin.reverseRightAlignedItems();
|
348 |
plugin.hideAllPanels();
|
170 |
});
|
171 |
|
172 |
$(document).on("click touchend", function(e) { // hide menu when clicked away from
|
173 |
+
if (!dragging && plugin.settings.document_click === "collapse" && ! $(e.target).closest(".mega-menu li").length && ! $(e.target).closest(".mega-menu-toggle").length ) {
|
174 |
plugin.hideAllPanels();
|
175 |
}
|
176 |
dragging = false;
|
177 |
});
|
178 |
|
179 |
$("> a.mega-menu-link", items_with_submenus).on("click.megamenu touchend.megamenu", function(e) {
|
180 |
+
if (e.type === 'touchend') {
|
181 |
+
// prevent mouseenter events once touch has been detected
|
182 |
+
plugin.unbindHoverEvents();
|
183 |
+
plugin.unbindHoverIntentEvents();
|
184 |
+
}
|
185 |
if (plugin.isDesktopView() && $(this).parent().hasClass("mega-toggle-on") && $(this).parent().parent().parent().hasClass("mega-menu-tabbed")) {
|
186 |
e.preventDefault();
|
187 |
return;
|
211 |
|
212 |
var bindHoverEvents = function() {
|
213 |
items_with_submenus.on({
|
214 |
+
"mouseenter.megamenu" : function() {
|
215 |
plugin.unbindClickEvents();
|
216 |
if (! $(this).hasClass("mega-toggle-on")) {
|
217 |
plugin.showPanel($(this).children("a.mega-menu-link"));
|
218 |
}
|
219 |
},
|
220 |
+
"mouseleave.megamenu" : function() {
|
221 |
if ($(this).hasClass("mega-toggle-on") && ! $(this).parent().parent().hasClass("mega-menu-tabbed")) {
|
222 |
plugin.hidePanel($(this).children("a.mega-menu-link"), false);
|
223 |
}
|
286 |
};
|
287 |
|
288 |
plugin.unbindClickEvents = function() {
|
289 |
+
$("> a.mega-menu-link", items_with_submenus).off("click.megamenu touchend.megamenu");
|
290 |
+
};
|
291 |
+
|
292 |
+
plugin.unbindHoverEvents = function() {
|
293 |
+
items_with_submenus.unbind("mouseenter.megamenu mouseleave.megamenu");
|
294 |
};
|
295 |
|
296 |
+
plugin.unbindHoverIntentEvents = function() {
|
297 |
+
items_with_submenus.unbind("mouseenter mouseleave").removeProp('hoverIntent_t').removeProp('hoverIntent_s'); // hoverintent does not allow namespaced events
|
298 |
+
};
|
299 |
+
|
300 |
+
plugin.unbindMegaMenuEvents = function() {
|
301 |
+
if (plugin.settings.event === "hover_intent") {
|
302 |
+
plugin.unbindHoverIntentEvents();
|
303 |
+
}
|
304 |
+
|
305 |
+
if (plugin.settings.event === "hover") {
|
306 |
+
plugin.unbindHoverEvents();
|
307 |
+
}
|
308 |
+
|
309 |
+
plugin.unbindClickEvents();
|
310 |
+
}
|
311 |
+
|
312 |
plugin.bindMegaMenuEvents = function() {
|
313 |
if (plugin.isDesktopView() && plugin.settings.event === "hover_intent") {
|
314 |
bindHoverIntentEvents();
|
360 |
};
|
361 |
|
362 |
plugin.switchToMobile = function() {
|
363 |
+
plugin.unbindMegaMenuEvents();
|
364 |
plugin.bindMegaMenuEvents();
|
365 |
plugin.reverseRightAlignedItems();
|
366 |
plugin.hideAllPanels();
|
367 |
};
|
368 |
|
369 |
plugin.switchToDesktop = function() {
|
370 |
+
plugin.unbindMegaMenuEvents();
|
371 |
plugin.bindMegaMenuEvents();
|
372 |
plugin.reverseRightAlignedItems();
|
373 |
plugin.hideAllPanels();
|
js/settings.js
CHANGED
@@ -150,7 +150,7 @@ jQuery(function ($) {
|
|
150 |
var value = $(this).val();
|
151 |
|
152 |
if ( ( validation == 'int' && Math.floor(value) != value )
|
153 |
-
|| ( validation == 'px' && ! ( value.substr(value.length - 2) == 'px' || value.substr(value.length - 2) == 'em' || value.substr(value.length - 2) == 'pt' || value.substr(value.length - 3) == 'rem' || value.substr(value.length - 1) == '%' ) && value != 0 )
|
154 |
|| ( validation == 'float' && ! $.isNumeric(value) ) ) {
|
155 |
label.addClass('mega-error');
|
156 |
error_message.show();
|
150 |
var value = $(this).val();
|
151 |
|
152 |
if ( ( validation == 'int' && Math.floor(value) != value )
|
153 |
+
|| ( validation == 'px' && ! ( value.substr(value.length - 2) == 'px' || value.substr(value.length - 2) == 'em' || value.substr(value.length - 2) == 'vh' || value.substr(value.length - 2) == 'vw' || value.substr(value.length - 2) == 'pt' || value.substr(value.length - 3) == 'rem' || value.substr(value.length - 1) == '%' ) && value != 0 )
|
154 |
|| ( validation == 'float' && ! $.isNumeric(value) ) ) {
|
155 |
label.addClass('mega-error');
|
156 |
error_message.show();
|
megamenu.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: Max Mega Menu
|
5 |
* Plugin URI: https://www.megamenu.com
|
6 |
* Description: Easy to use drag & drop WordPress Mega Menu plugin. Create Mega Menus using Widgets. Responsive, retina & touch ready.
|
7 |
-
* Version: 2.3.
|
8 |
* Author: Tom Hemsley
|
9 |
* Author URI: https://www.megamenu.com
|
10 |
* License: GPL-2.0+
|
@@ -26,7 +26,7 @@ final class Mega_Menu {
|
|
26 |
/**
|
27 |
* @var string
|
28 |
*/
|
29 |
-
public $version = '2.3.
|
30 |
|
31 |
|
32 |
/**
|
4 |
* Plugin Name: Max Mega Menu
|
5 |
* Plugin URI: https://www.megamenu.com
|
6 |
* Description: Easy to use drag & drop WordPress Mega Menu plugin. Create Mega Menus using Widgets. Responsive, retina & touch ready.
|
7 |
+
* Version: 2.3.8
|
8 |
* Author: Tom Hemsley
|
9 |
* Author URI: https://www.megamenu.com
|
10 |
* License: GPL-2.0+
|
26 |
/**
|
27 |
* @var string
|
28 |
*/
|
29 |
+
public $version = '2.3.8';
|
30 |
|
31 |
|
32 |
/**
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: megamenu
|
|
3 |
Tags: menu, megamenu, mega menu, navigation, widget, dropdown menu, drag and drop, mobile, responsive, retina, theme editor, widget, shortcode, sidebar, icons, dashicons
|
4 |
Requires at least: 3.8
|
5 |
Tested up to: 4.8
|
6 |
-
Stable tag: 2.3.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -96,6 +96,17 @@ See https://www.megamenu.com for more screenshots
|
|
96 |
|
97 |
== Changelog ==
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
= 2.3.7 [06/07/17]=
|
100 |
|
101 |
* Compatibility with WordPress 4.8 Text and Media Widgets
|
3 |
Tags: menu, megamenu, mega menu, navigation, widget, dropdown menu, drag and drop, mobile, responsive, retina, theme editor, widget, shortcode, sidebar, icons, dashicons
|
4 |
Requires at least: 3.8
|
5 |
Tested up to: 4.8
|
6 |
+
Stable tag: 2.3.7.1
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
96 |
|
97 |
== Changelog ==
|
98 |
|
99 |
+
= 2.3.8 [25/08/17] =
|
100 |
+
|
101 |
+
* Fix: Compatibility fix for Reamaze plugin
|
102 |
+
* Fix: Respect the 'Unbind JavaScript Events' setting on mobile menus
|
103 |
+
* Improvement: Add support for vh/vw units in theme editor
|
104 |
+
* Change: Don't close open sub menus when mobile toggle is clicked
|
105 |
+
|
106 |
+
= 2.3.7.1 [06/07/17]=
|
107 |
+
|
108 |
+
* Fix: Conflict with Site Origin Page Builder
|
109 |
+
|
110 |
= 2.3.7 [06/07/17]=
|
111 |
|
112 |
* Compatibility with WordPress 4.8 Text and Media Widgets
|