Max Mega Menu - Version 2.2.3.3

Version Description

Download this release

Release Info

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

Code changes from version 2.2.3.2 to 2.2.3.3

classes/menu-item-manager.class.php CHANGED
@@ -34,9 +34,132 @@ class Mega_Menu_Menu_Item_Manager {
34
  add_filter( 'megamenu_tabs', array( $this, 'add_mega_menu_tab'), 10, 5 );
35
  add_filter( 'megamenu_tabs', array( $this, 'add_general_settings_tab'), 10, 5 );
36
  add_filter( 'megamenu_tabs', array( $this, 'add_icon_tab'), 10, 5 );
 
 
 
37
 
38
  }
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
 
41
  /**
42
  * Set up the class
@@ -187,7 +310,7 @@ class Mega_Menu_Menu_Item_Manager {
187
  * Return the HTML to display in the 'Mega Menu' tab
188
  *
189
  * @since 1.7
190
- * @return string
191
  */
192
  public function add_mega_menu_tab( $tabs, $menu_item_id, $menu_id, $menu_item_depth, $menu_item_meta ) {
193
 
@@ -282,7 +405,7 @@ class Mega_Menu_Menu_Item_Manager {
282
  * Return the HTML to display in the 'General Settings' tab
283
  *
284
  * @since 1.7
285
- * @return string
286
  */
287
  public function add_general_settings_tab( $tabs, $menu_item_id, $menu_id, $menu_item_depth, $menu_item_meta ) {
288
 
@@ -404,7 +527,7 @@ class Mega_Menu_Menu_Item_Manager {
404
  * Return the HTML to display in the 'menu icon' tab
405
  *
406
  * @since 1.7
407
- * @return string
408
  */
409
  public function add_icon_tab( $tabs, $menu_item_id, $menu_id, $menu_item_depth, $menu_item_meta ) {
410
 
@@ -463,6 +586,7 @@ class Mega_Menu_Menu_Item_Manager {
463
  * Return the form to select a dashicon
464
  *
465
  * @since 1.5.2
 
466
  */
467
  private function dashicon_selector() {
468
 
34
  add_filter( 'megamenu_tabs', array( $this, 'add_mega_menu_tab'), 10, 5 );
35
  add_filter( 'megamenu_tabs', array( $this, 'add_general_settings_tab'), 10, 5 );
36
  add_filter( 'megamenu_tabs', array( $this, 'add_icon_tab'), 10, 5 );
37
+ add_filter( 'megamenu_tabs', array( $this, 'add_custom_styling_tab'), 10, 5 );
38
+ add_filter( 'megamenu_tabs', array( $this, 'add_roles_tab'), 10, 5 );
39
+ add_filter( 'megamenu_tabs', array( $this, 'add_replacements_tab'), 10, 5 );
40
 
41
  }
42
 
43
+ /**
44
+ * Return the HTML to display in the 'Styling' tab
45
+ *
46
+ * @since 1.7
47
+ * @return array
48
+ */
49
+ public function add_custom_styling_tab( $tabs, $menu_item_id, $menu_id, $menu_item_depth, $menu_item_meta ) {
50
+
51
+ if ( $this->nags_are_hidden() || is_plugin_active('megamenu-pro/megamenu-pro.php') ) {
52
+ return $tabs;
53
+ }
54
+
55
+ $return = '<h4 class="first">' . __("Custom Item Styling", "megamenu") . '</h4>';
56
+ $return .= "<p class='tab-description'>" . __("Customize the styling of this menu item only.", "megamenu_pro") . "</p>";
57
+ $return .= "<p class='tab-description'>" . __("Set custom sub menu widths, font colors, font size, icon styling, sub menu background images and lots more.", "megamenu_pro") . "</p>";
58
+
59
+ $return .= $this->get_pro_upgrade_text();
60
+
61
+ $tabs['pro_custom_styling'] = array(
62
+ 'title' => __('Styling', 'megamenu'),
63
+ 'content' => $return
64
+ );
65
+
66
+ return $tabs;
67
+
68
+ }
69
+
70
+ /**
71
+ * Return the HTML to display in the 'Roles' tab
72
+ *
73
+ * @since 2.2.3.2
74
+ * @return array
75
+ */
76
+ public function add_roles_tab( $tabs, $menu_item_id, $menu_id, $menu_item_depth, $menu_item_meta ) {
77
+
78
+ if ( $this->nags_are_hidden() || is_plugin_active('megamenu-pro/megamenu-pro.php') ) {
79
+ return $tabs;
80
+ }
81
+
82
+ $return = '<h4 class="first">' . __("Roles & Restrictions", "megamenu") . '</h4>';
83
+ $return .= "<p class='tab-description'>" . __("Restrict the display of this menu item to users with a specific role, or by logged in status.", "megamenu_pro") . "</p>";
84
+ $return .= $this->get_pro_upgrade_text();
85
+
86
+ $tabs['pro_roles'] = array(
87
+ 'title' => __('Roles', 'megamenu'),
88
+ 'content' => $return
89
+ );
90
+
91
+ return $tabs;
92
+
93
+ }
94
+
95
+
96
+ /**
97
+ * Return the HTML to display in the 'Replacements' tab
98
+ *
99
+ * @since 2.2.3.2
100
+ * @return array
101
+ */
102
+ public function add_replacements_tab( $tabs, $menu_item_id, $menu_id, $menu_item_depth, $menu_item_meta ) {
103
+
104
+ if ( $this->nags_are_hidden() || is_plugin_active('megamenu-pro/megamenu-pro.php') ) {
105
+ return $tabs;
106
+ }
107
+
108
+ $return = '<h4 class="first">' . __("Replacements", "megamenu") . '</h4>';
109
+ $return .= '<p class="tab-description">' . __("Replace this menu item with something else: a logo, a search box, WooCommerce cart total, Easy Digital Downloads cart total, custom HTML or a shortcode", "megamenu_pro") . "</p>";
110
+ $return .= $this->get_pro_upgrade_text();
111
+
112
+
113
+ $tabs['pro_replacements'] = array(
114
+ 'title' => __('Replacements', 'megamenu'),
115
+ 'content' => $return
116
+ );
117
+
118
+ return $tabs;
119
+
120
+ }
121
+
122
+
123
+ /**
124
+ * Return the text for displaying go pro nag
125
+ *
126
+ * @since 2.2.3.2
127
+ * @return string
128
+ */
129
+ private function get_pro_upgrade_text() {
130
+
131
+ $return = '<div class="in-pro">';
132
+ $return .= "<p>This functionality is available in <a href='https://www.maxmegamenu.com/upgrade/?utm_source=free&amp;utm_medium=lightbox&amp;utm_campaign=pro' target='_blank'>Max Mega Menu Pro</a><span class='dashicons dashicons-migrate'></span></p>";
133
+ $return .= '<p><a class="hide-pro-nags">Hide this notice for 90 days</a></p>';
134
+ $return .= '</div>';
135
+
136
+ return $return;
137
+
138
+ }
139
+
140
+
141
+ /**
142
+ * Returns true if nags have been hidden within the past 90 days
143
+ * (I really wish I did not have to put in nags, but development and support is entirely funded
144
+ * by upgrades)
145
+ *
146
+ * @since 2.2.3.2
147
+ * @return bool
148
+ */
149
+ private function nags_are_hidden() {
150
+ $transient = get_transient('megamenu_nag');
151
+
152
+ if ( ! $transient ) {
153
+ return false;
154
+ }
155
+
156
+ if ( strtotime("+90 days", $transient) > time() ) {
157
+ return true;
158
+ }
159
+
160
+ return false;
161
+ }
162
+
163
 
164
  /**
165
  * Set up the class
310
  * Return the HTML to display in the 'Mega Menu' tab
311
  *
312
  * @since 1.7
313
+ * @return array
314
  */
315
  public function add_mega_menu_tab( $tabs, $menu_item_id, $menu_id, $menu_item_depth, $menu_item_meta ) {
316
 
405
  * Return the HTML to display in the 'General Settings' tab
406
  *
407
  * @since 1.7
408
+ * @return array
409
  */
410
  public function add_general_settings_tab( $tabs, $menu_item_id, $menu_id, $menu_item_depth, $menu_item_meta ) {
411
 
527
  * Return the HTML to display in the 'menu icon' tab
528
  *
529
  * @since 1.7
530
+ * @return array
531
  */
532
  public function add_icon_tab( $tabs, $menu_item_id, $menu_id, $menu_item_depth, $menu_item_meta ) {
533
 
586
  * Return the form to select a dashicon
587
  *
588
  * @since 1.5.2
589
+ * @return string
590
  */
591
  private function dashicon_selector() {
592
 
classes/nav-menus.class.php CHANGED
@@ -47,6 +47,7 @@ class Mega_Menu_Nav_Menus {
47
  add_action( 'admin_init', array( $this, 'register_nav_meta_box' ), 9 );
48
  add_action( 'megamenu_nav_menus_scripts', array( $this, 'enqueue_menu_page_scripts' ), 9 );
49
  add_action( 'wp_ajax_mm_save_settings', array($this, 'save') );
 
50
  add_filter( 'hidden_meta_boxes', array( $this, 'show_mega_menu_metabox' ) );
51
 
52
  if ( function_exists( 'siteorigin_panels_admin_enqueue_scripts' ) ) {
@@ -207,6 +208,20 @@ class Mega_Menu_Nav_Menus {
207
 
208
  }
209
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
 
211
  /**
212
  * Save the mega menu settings (submitted from Menus Page Meta Box)
47
  add_action( 'admin_init', array( $this, 'register_nav_meta_box' ), 9 );
48
  add_action( 'megamenu_nav_menus_scripts', array( $this, 'enqueue_menu_page_scripts' ), 9 );
49
  add_action( 'wp_ajax_mm_save_settings', array($this, 'save') );
50
+ add_action( 'wp_ajax_mm_hide_nags', array($this, 'set_nag_transient') );
51
  add_filter( 'hidden_meta_boxes', array( $this, 'show_mega_menu_metabox' ) );
52
 
53
  if ( function_exists( 'siteorigin_panels_admin_enqueue_scripts' ) ) {
208
 
209
  }
210
 
211
+ /**
212
+ * Set a transient to note the time at which the 'Hide go pro nag' link was clicked
213
+ *
214
+ * @since 2.2.3.2
215
+ */
216
+ public function set_nag_transient() {
217
+
218
+ check_ajax_referer( 'megamenu_edit', 'nonce' );
219
+
220
+ set_transient('megamenu_nag', time() );
221
+
222
+ wp_die(__("No problem! This tab will be hidden for the next 90 days.", "megamenu"));
223
+
224
+ }
225
 
226
  /**
227
  * Save the mega menu settings (submitted from Menus Page Meta Box)
classes/style-manager.class.php CHANGED
@@ -42,6 +42,9 @@ final class Mega_Menu_Style_Manager {
42
 
43
  add_action( 'megamenu_delete_cache', array( $this, 'delete_cache' ) );
44
  add_action( 'after_switch_theme', array( $this, 'delete_cache') );
 
 
 
45
 
46
  // PolyLang
47
  if ( function_exists( 'pll_current_language' ) ) {
@@ -58,11 +61,11 @@ final class Mega_Menu_Style_Manager {
58
 
59
 
60
  /**
61
- *
62
  */
63
  public function get_default_theme() {
64
  return apply_filters("megamenu_default_theme", array(
65
- 'title' => __("Default", "megamenu"),
66
  'container_background_from' => '#222',
67
  'container_background_to' => '#222',
68
  'container_padding_left' => '0px',
@@ -276,6 +279,197 @@ final class Mega_Menu_Style_Manager {
276
  }
277
 
278
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
  /**
280
  * Merge the saved themes (from options table) into array of complete themes
281
  *
42
 
43
  add_action( 'megamenu_delete_cache', array( $this, 'delete_cache' ) );
44
  add_action( 'after_switch_theme', array( $this, 'delete_cache') );
45
+ add_filter( 'megamenu_themes', array( $this, 'megamenu_add_theme_light') );
46
+ add_filter( 'megamenu_themes', array( $this, 'megamenu_add_theme_light_transparent') );
47
+ add_filter( 'megamenu_themes', array( $this, 'megamenu_add_theme_dark_transparent') );
48
 
49
  // PolyLang
50
  if ( function_exists( 'pll_current_language' ) ) {
61
 
62
 
63
  /**
64
+ * Return the default menu theme
65
  */
66
  public function get_default_theme() {
67
  return apply_filters("megamenu_default_theme", array(
68
+ 'title' => __("Dark", "megamenu"),
69
  'container_background_from' => '#222',
70
  'container_background_to' => '#222',
71
  'container_padding_left' => '0px',
279
  }
280
 
281
 
282
+ /**
283
+ * Add light transparent theme - light links on dark background
284
+ *
285
+ * @param array $themes
286
+ * @since 2.2.3
287
+ * @return array
288
+ */
289
+ public function megamenu_add_theme_light_transparent( $themes ) {
290
+ $themes["default_light_transparent"] = array(
291
+ 'title' => 'Light (Transparent)',
292
+ 'container_background_from' => 'rgba(255, 255, 255, 0)',
293
+ 'container_background_to' => 'rgba(255, 255, 255, 0)',
294
+ 'menu_item_background_hover_from' => 'rgba(255, 255, 255, 0)',
295
+ 'menu_item_background_hover_to' => 'rgba(255, 255, 255, 0)',
296
+ 'menu_item_link_color' => 'rgb(250,250,250)',
297
+ 'menu_item_link_color_hover' => 'rgb(255,255,255)',
298
+ 'panel_background_from' => 'rgb(250, 250, 250)',
299
+ 'panel_background_to' => 'rgb(248, 248, 248)',
300
+ 'panel_header_text_transform' => 'none',
301
+ 'panel_header_border_color' => '#555',
302
+ 'panel_font_size' => '14px',
303
+ 'panel_font_color' => '#666',
304
+ 'panel_font_family' => 'inherit',
305
+ 'panel_second_level_font_color' => 'rgb(102, 102, 102)',
306
+ 'panel_second_level_font_color_hover' => 'rgb(34, 34, 34)',
307
+ 'panel_second_level_text_transform' => 'none',
308
+ 'panel_second_level_font' => 'inherit',
309
+ 'panel_second_level_font_size' => '16px',
310
+ 'panel_second_level_font_weight' => 'bold',
311
+ 'panel_second_level_font_weight_hover' => 'bold',
312
+ 'panel_second_level_text_decoration' => 'none',
313
+ 'panel_second_level_text_decoration_hover' => 'none',
314
+ 'panel_second_level_padding_bottom' => '5px',
315
+ 'panel_second_level_border_color' => '#555',
316
+ 'panel_third_level_font_color' => 'rgb(102, 102, 102)',
317
+ 'panel_third_level_font_color_hover' => 'rgb(34, 34, 34)',
318
+ 'panel_third_level_font' => 'inherit',
319
+ 'panel_third_level_font_size' => '14px',
320
+ 'flyout_width' => '175px',
321
+ 'flyout_menu_background_from' => 'rgb(250, 250, 250)',
322
+ 'flyout_menu_background_to' => 'rgb(250, 250, 250)',
323
+ 'flyout_background_from' => 'rgba(255, 255, 255, 0)',
324
+ 'flyout_background_to' => 'rgba(255, 255, 255, 0)',
325
+ 'flyout_background_hover_from' => 'rgba(255, 255, 255, 0)',
326
+ 'flyout_background_hover_to' => 'rgba(255, 255, 255, 0)',
327
+ 'flyout_link_size' => '14px',
328
+ 'flyout_link_color' => '#666',
329
+ 'flyout_link_color_hover' => 'rgb(34, 34, 34)',
330
+ 'flyout_link_family' => 'inherit',
331
+ 'toggle_background_from' => '#222',
332
+ 'toggle_background_to' => '#222',
333
+ 'toggle_font_color' => 'rgb(85, 85, 85)',
334
+ 'mobile_background_from' => 'rgb(255, 255, 255)',
335
+ 'mobile_background_to' => 'rgb(255, 255, 255)',
336
+ 'transitions' => 'on',
337
+ 'custom_css' => '/** Push menu onto new line **/
338
+ #{$wrap} {
339
+ clear: both;
340
+ }'
341
+ );
342
+ return $themes;
343
+ }
344
+
345
+
346
+ /**
347
+ * Add Dark transparent - dark links on transparent background
348
+ *
349
+ * @param array $themes
350
+ * @since 2.2.3
351
+ * @return array
352
+ */
353
+ public function megamenu_add_theme_dark_transparent( $themes ) {
354
+ $themes["default_dark_transparent"] = array(
355
+ 'title' => 'Dark (Transparent)',
356
+ 'container_background_from' => 'rgba(255, 255, 255, 0)',
357
+ 'container_background_to' => 'rgba(255, 255, 255, 0)',
358
+ 'menu_item_background_hover_from' => 'rgba(255, 255, 255, 0)',
359
+ 'menu_item_background_hover_to' => 'rgba(255, 255, 255, 0)',
360
+ 'menu_item_link_color' => 'rgb(85, 85, 85)',
361
+ 'menu_item_link_color_hover' => 'rgb(34, 34, 34)',
362
+ 'panel_background_from' => 'rgb(250, 250, 250)',
363
+ 'panel_background_to' => 'rgb(248, 248, 248)',
364
+ 'panel_header_text_transform' => 'none',
365
+ 'panel_header_border_color' => '#555',
366
+ 'panel_font_size' => '14px',
367
+ 'panel_font_color' => '#666',
368
+ 'panel_font_family' => 'inherit',
369
+ 'panel_second_level_font_color' => 'rgb(102, 102, 102)',
370
+ 'panel_second_level_font_color_hover' => 'rgb(34, 34, 34)',
371
+ 'panel_second_level_text_transform' => 'none',
372
+ 'panel_second_level_font' => 'inherit',
373
+ 'panel_second_level_font_size' => '16px',
374
+ 'panel_second_level_font_weight' => 'bold',
375
+ 'panel_second_level_font_weight_hover' => 'bold',
376
+ 'panel_second_level_text_decoration' => 'none',
377
+ 'panel_second_level_text_decoration_hover' => 'none',
378
+ 'panel_second_level_padding_bottom' => '5px',
379
+ 'panel_second_level_border_color' => '#555',
380
+ 'panel_third_level_font_color' => 'rgb(102, 102, 102)',
381
+ 'panel_third_level_font_color_hover' => 'rgb(34, 34, 34)',
382
+ 'panel_third_level_font' => 'inherit',
383
+ 'panel_third_level_font_size' => '14px',
384
+ 'flyout_width' => '175px',
385
+ 'flyout_menu_background_from' => 'rgb(250, 250, 250)',
386
+ 'flyout_menu_background_to' => 'rgb(250, 250, 250)',
387
+ 'flyout_background_from' => 'rgba(255, 255, 255, 0)',
388
+ 'flyout_background_to' => 'rgba(255, 255, 255, 0)',
389
+ 'flyout_background_hover_from' => 'rgba(255, 255, 255, 0)',
390
+ 'flyout_background_hover_to' => 'rgba(255, 255, 255, 0)',
391
+ 'flyout_link_size' => '14px',
392
+ 'flyout_link_color' => '#666',
393
+ 'flyout_link_color_hover' => 'rgb(34, 34, 34)',
394
+ 'flyout_link_family' => 'inherit',
395
+ 'toggle_background_from' => '#222',
396
+ 'toggle_background_to' => '#222',
397
+ 'toggle_font_color' => 'rgb(85, 85, 85)',
398
+ 'mobile_background_from' => 'rgb(255, 255, 255)',
399
+ 'mobile_background_to' => 'rgb(255, 255, 255)',
400
+ 'transitions' => 'on',
401
+ 'custom_css' => '/** Push menu onto new line **/
402
+ #{$wrap} {
403
+ clear: both;
404
+ }'
405
+ );
406
+ return $themes;
407
+ }
408
+
409
+ /**
410
+ * Add light theme
411
+ *
412
+ * @param array $themes
413
+ * @since 2.2.3
414
+ * @return array
415
+ */
416
+ public function megamenu_add_theme_light( $themes ) {
417
+ $themes["default_light"] = array(
418
+ 'title' => 'Light',
419
+ 'container_background_from' => 'rgb(255, 255, 255)',
420
+ 'container_background_to' => 'rgb(255, 255, 255)',
421
+ 'menu_item_background_hover_from' => 'rgba(255, 255, 255, 0)',
422
+ 'menu_item_background_hover_to' => 'rgba(255, 255, 255, 0)',
423
+ 'menu_item_link_color' => 'rgb(85, 85, 85)',
424
+ 'menu_item_link_color_hover' => 'rgb(34, 34, 34)',
425
+ 'panel_background_from' => 'rgb(250, 250, 250)',
426
+ 'panel_background_to' => 'rgb(248, 248, 248)',
427
+ 'panel_header_text_transform' => 'none',
428
+ 'panel_header_border_color' => '#555',
429
+ 'panel_font_size' => '14px',
430
+ 'panel_font_color' => '#666',
431
+ 'panel_font_family' => 'inherit',
432
+ 'panel_second_level_font_color' => 'rgb(102, 102, 102)',
433
+ 'panel_second_level_font_color_hover' => 'rgb(34, 34, 34)',
434
+ 'panel_second_level_text_transform' => 'none',
435
+ 'panel_second_level_font' => 'inherit',
436
+ 'panel_second_level_font_size' => '16px',
437
+ 'panel_second_level_font_weight' => 'bold',
438
+ 'panel_second_level_font_weight_hover' => 'bold',
439
+ 'panel_second_level_text_decoration' => 'none',
440
+ 'panel_second_level_text_decoration_hover' => 'none',
441
+ 'panel_second_level_padding_bottom' => '5px',
442
+ 'panel_second_level_border_color' => '#555',
443
+ 'panel_third_level_font_color' => 'rgb(102, 102, 102)',
444
+ 'panel_third_level_font_color_hover' => 'rgb(34, 34, 34)',
445
+ 'panel_third_level_font' => 'inherit',
446
+ 'panel_third_level_font_size' => '14px',
447
+ 'flyout_width' => '175px',
448
+ 'flyout_menu_background_from' => 'rgb(250, 250, 250)',
449
+ 'flyout_menu_background_to' => 'rgb(250, 250, 250)',
450
+ 'flyout_background_from' => 'rgba(255, 255, 255, 0)',
451
+ 'flyout_background_to' => 'rgba(255, 255, 255, 0)',
452
+ 'flyout_background_hover_from' => 'rgba(255, 255, 255, 0)',
453
+ 'flyout_background_hover_to' => 'rgba(255, 255, 255, 0)',
454
+ 'flyout_link_size' => '14px',
455
+ 'flyout_link_color' => '#666',
456
+ 'flyout_link_color_hover' => 'rgb(34, 34, 34)',
457
+ 'flyout_link_family' => 'inherit',
458
+ 'toggle_background_from' => '#222',
459
+ 'toggle_background_to' => '#222',
460
+ 'toggle_font_color' => 'rgb(85, 85, 85)',
461
+ 'mobile_background_from' => 'rgb(255, 255, 255)',
462
+ 'mobile_background_to' => 'rgb(255, 255, 255)',
463
+ 'transitions' => 'on',
464
+ 'custom_css' => '/** Push menu onto new line **/
465
+ #{$wrap} {
466
+ clear: both;
467
+ }'
468
+ );
469
+ return $themes;
470
+ }
471
+
472
+
473
  /**
474
  * Merge the saved themes (from options table) into array of complete themes
475
  *
classes/toggle-blocks.class.php CHANGED
@@ -134,6 +134,18 @@ class Mega_Menu_Toggle_Blocks {
134
  "id" => "mega-toggle-block-{$block_id}"
135
  ), $block, $content, $nav_menu, $args, $theme_id);
136
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  $blocks_html .= "<div";
138
 
139
  foreach ( $attributes as $attribute => $val ) {
@@ -426,6 +438,13 @@ class Mega_Menu_Toggle_Blocks {
426
  <?php foreach( $block_types as $block_id => $block_name ) : ?>
427
  <option value='<?php echo $block_id; ?>'><?php echo $block_name ?></option>
428
  <?php endforeach; ?>
 
 
 
 
 
 
 
429
  </select>
430
 
431
  <div class='toggle-bar-designer'>
134
  "id" => "mega-toggle-block-{$block_id}"
135
  ), $block, $content, $nav_menu, $args, $theme_id);
136
 
137
+ /**
138
+ *
139
+ * function remove_ids_from_toggle_blocks($attributes, $block, $content, $nav_menu, $args, $theme_id) {
140
+ * if (isset($attributes['id'])) {
141
+ * unset($attributes['id']);
142
+ * }
143
+ * return $attributes;
144
+ * }
145
+ * add_filter('megamenu_toggle_block_attributes', 'remove_ids_from_toggle_blocks');
146
+ *
147
+ */
148
+
149
  $blocks_html .= "<div";
150
 
151
  foreach ( $attributes as $attribute => $val ) {
438
  <?php foreach( $block_types as $block_id => $block_name ) : ?>
439
  <option value='<?php echo $block_id; ?>'><?php echo $block_name ?></option>
440
  <?php endforeach; ?>
441
+
442
+ <?php if ( ! is_plugin_active('megamenu-pro/megamenu-pro.php') ): ?>
443
+ <option disabled="disabled">Search (Pro)</option>
444
+ <option disabled="disabled">Logo (Pro)</option>
445
+ <option disabled="disabled">Icon (Pro)</option>
446
+ <option disabled="disabled">HTML (Pro)</option>
447
+ <?php endif; ?>
448
  </select>
449
 
450
  <div class='toggle-bar-designer'>
css/admin/global.css CHANGED
@@ -1,25 +1,19 @@
1
  @font-face {
2
  font-family: 'maxmegamenu';
3
- src: url('../../font/maxmegamenu.eot?86003086');
4
- src: url('../../font/maxmegamenu.eot?86003086#iefix') format('embedded-opentype'),
5
- url('../../font/maxmegamenu.woff?86003086') format('woff'),
6
- url('../../font/maxmegamenu.ttf?86003086') format('truetype'),
7
- url('../../font/maxmegamenu.svg?86003086#maxmegamenu') format('svg');
 
8
  font-weight: normal;
9
  font-style: normal;
10
  }
11
 
12
  #adminmenu .toplevel_page_maxmegamenu div.wp-menu-image:before {
13
- content: "\e800" !important;
14
  font-family: "maxmegamenu" !important;
15
- font-style: normal !important;
16
- font-weight: normal !important;
17
- font-variant: normal !important;
18
- text-transform: none !important;
19
  speak: none;
20
- font-size: 20px;
21
- line-height: 1.3;
22
- margin-top: -3px;
23
- -webkit-font-smoothing: antialiased;
24
- -moz-osx-font-smoothing: grayscale;
25
  }
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/admin/menus.css CHANGED
@@ -80,15 +80,54 @@
80
  font-size: 12px;
81
  }
82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  #cboxContent .mm_tab_container .mm_tab.active {
84
  color: #333;
85
  color: white;
86
  }
87
 
88
- #cboxContent .mm_tab_container .mm_tab:hover {
89
- background: #dfdfdf;
90
- }
91
-
92
  #cboxContent .mm_tab_container .mm_tab.active {
93
  background: #2ea2cc;
94
  }
@@ -116,6 +155,7 @@
116
  -moz-box-shadow: inset -10px 0px 7px -12px rgba(0,0,0,0.2);
117
  box-shadow: inset -10px 0px 7px -12px rgba(0,0,0,0.2);
118
  }
 
119
  #cboxContent .mm_content_container {
120
  padding: 20px;
121
  float: right;
80
  font-size: 12px;
81
  }
82
 
83
+ #cboxContent .mm_tab_container .mm_tab.pro_custom_styling,
84
+ #cboxContent .mm_tab_container .mm_tab.pro_roles,
85
+ #cboxContent .mm_tab_container .mm_tab.pro_replacements {
86
+ color: #ccc;
87
+ }
88
+
89
+ #cboxContent .mm_tab_container .mm_tab.pro_custom_styling.active,
90
+ #cboxContent .mm_tab_container .mm_tab.pro_roles.active,
91
+ #cboxContent .mm_tab_container .mm_tab.pro_replacements.active {
92
+ color: #333;
93
+ background: #dfdfdf;
94
+ }
95
+
96
+ #cboxContent .mm_content.pro_custom_styling a,
97
+ #cboxContent .mm_content.pro_roles a,
98
+ #cboxContent .mm_content.pro_replacements a {
99
+ text-decoration: none;
100
+ }
101
+ #cboxContent .mm_content.pro_custom_styling span.dashicons,
102
+ #cboxContent .mm_content.pro_roles span.dashicons,
103
+ #cboxContent .mm_content.pro_replacements span.dashicons {
104
+ font-size: 0.9em;
105
+ }
106
+
107
+ #cboxContent div.in-pro {
108
+ background: #efefef;
109
+ padding: 20px;
110
+ max-width: 400px;
111
+ margin: 50px auto;
112
+ text-align: center;
113
+ }
114
+
115
+ #cboxContent div.in-pro a.hide-pro-nags {
116
+ color: #888;
117
+ font-size: 0.8em;
118
+ cursor: pointer;
119
+ }
120
+
121
+ #cboxContent p.tab-description {
122
+ font-style: italic;
123
+ }
124
+
125
+
126
  #cboxContent .mm_tab_container .mm_tab.active {
127
  color: #333;
128
  color: white;
129
  }
130
 
 
 
 
 
131
  #cboxContent .mm_tab_container .mm_tab.active {
132
  background: #2ea2cc;
133
  }
155
  -moz-box-shadow: inset -10px 0px 7px -12px rgba(0,0,0,0.2);
156
  box-shadow: inset -10px 0px 7px -12px rgba(0,0,0,0.2);
157
  }
158
+
159
  #cboxContent .mm_content_container {
160
  padding: 20px;
161
  float: right;
css/admin/settings.css CHANGED
@@ -160,7 +160,7 @@ body[class*='mega-menu_page_maxmegamenu_'] .menu_settings h3 {
160
  line-height: 30px;
161
  }
162
  .megamenu_outer_wrap .megamenu_header_top ul li.mega-highlight {
163
- background: #00b7bf;
164
  border-radius: 5px;
165
  }
166
  .megamenu_outer_wrap .megamenu_header_top ul li.mega-highlight a {
160
  line-height: 30px;
161
  }
162
  .megamenu_outer_wrap .megamenu_header_top ul li.mega-highlight {
163
+ background: #35b1df;
164
  border-radius: 5px;
165
  }
166
  .megamenu_outer_wrap .megamenu_header_top ul li.mega-highlight a {
css/megamenu.scss CHANGED
@@ -119,6 +119,7 @@
119
 
120
  li.mega-menu-item.mega-animating > ul.mega-sub-menu {
121
  visibility: visible;
 
122
  }
123
 
124
  &[data-effect="fade"] {
119
 
120
  li.mega-menu-item.mega-animating > ul.mega-sub-menu {
121
  visibility: visible;
122
+ pointer-events: none;
123
  }
124
 
125
  &[data-effect="fade"] {
font/maxmegamenu.eot CHANGED
Binary file
font/maxmegamenu.svg CHANGED
@@ -1,12 +1,12 @@
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) 2015 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="logo-best" unicode="&#xe800;" d="m392 850l1 0c1-1 1-1 2-2 31-23 63-44 95-65 89-61 178-121 267-181 9-6 18-12 27-18l0-1c-13-8-26-17-39-25-117-79-234-157-351-235-2 0-4-1-6 0-89 60-179 120-269 180-40 27-79 54-119 80l0 1c16 11 32 22 48 33 111 74 221 149 331 224 5 3 9 5 13 9l0 0z m-392-386c70-46 140-93 211-139 60-40 120-80 181-119 130 86 261 172 392 258l0-355c-6-4-12-7-17-11-34-22-67-44-101-67 0 10 0 19 0 29 0 69 0 139 0 208-88-58-176-116-264-174-3-2-6-4-10-6-1-1-1 0-2 0-91 60-182 120-273 180 0-79 0-158 0-237-39 26-78 52-117 78l0 355 0 0z m236-392c52-35 104-69 156-103 52 34 104 69 156 103 0-30 0-60 0-90 0-9 0-19 1-28-53-35-105-69-157-104-50 33-100 66-150 99-2 2-6 3-6 5 0 39 0 79 0 118l0 0z" horiz-adv-x="784" />
10
  </font>
11
  </defs>
12
  </svg>
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="&#xe802;" 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 CHANGED
Binary file
font/maxmegamenu.woff CHANGED
Binary file
font/maxmegamenu.woff2 ADDED
Binary file
js/admin.js CHANGED
@@ -517,6 +517,7 @@
517
  jQuery(function ($) {
518
  "use strict";
519
 
 
520
  $(".menu").on("click", ".megamenu_launch", function (e) {
521
  e.preventDefault();
522
 
@@ -600,4 +601,18 @@ jQuery(function ($) {
600
  $(".mega_menu_meta_box .spinner").css('visibility', 'hidden');
601
  });
602
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
603
  });
517
  jQuery(function ($) {
518
  "use strict";
519
 
520
+
521
  $(".menu").on("click", ".megamenu_launch", function (e) {
522
  e.preventDefault();
523
 
601
  $(".mega_menu_meta_box .spinner").css('visibility', 'hidden');
602
  });
603
  });
604
+
605
+ });
606
+
607
+ jQuery(document).on('megamenu_content_loaded', function() {
608
+ jQuery('.hide-pro-nags').on('click', function(e) {
609
+ e.preventDefault();
610
+
611
+ jQuery.post(ajaxurl, {
612
+ action: "mm_hide_nags",
613
+ nonce: megamenu.nonce
614
+ }, function (response) {
615
+ jQuery('.hide-pro-nags').html(response);
616
+ });
617
+ });
618
  });
js/maxmegamenu.js CHANGED
@@ -28,13 +28,6 @@
28
 
29
  plugin.settings = {};
30
 
31
- /**
32
- * Returns true if touch events are detected
33
- */
34
- var isTouchDevice = function() {
35
- return ("ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0 || (window.DocumentTouch && document instanceof DocumentTouch));
36
- };
37
-
38
 
39
  /**
40
  * Hides a single panel (sub menu)
@@ -57,20 +50,20 @@
57
  }
58
 
59
  if (effect.animate) {
60
-
61
  anchor.siblings(".mega-sub-menu").animate(effect.animate, speed, function() {
62
  anchor.parent().removeClass("mega-toggle-on").triggerHandler("close_panel");
63
  });
 
64
  anchor.siblings(".mega-sub-menu").each( function() {
65
- plugin.add_animating_class(anchor.parent());
66
  });
67
  } else {
68
  anchor.parent().removeClass("mega-toggle-on").triggerHandler("close_panel");
69
- plugin.add_animating_class(anchor.parent());
70
  }
71
  } else {
72
  anchor.parent().removeClass("mega-toggle-on").triggerHandler("close_panel");
73
- plugin.add_animating_class(anchor.parent());
74
  }
75
 
76
  };
@@ -80,7 +73,7 @@
80
  * Adds an animating class to the sub menu whilst it is closing.
81
  * This allows the CSS3 animation to complete before the element is hidden.
82
  */
83
- plugin.add_animating_class = function(element) {
84
  if (plugin.settings.effect === "disabled") {
85
  return;
86
  }
@@ -110,7 +103,7 @@
110
  */
111
  plugin.hideSiblingPanels = function(anchor, immediate) {
112
  // jQuery 1.7.2 compatibility for themes/plugins that load old versions of jQuery
113
- if ( $.fn.addBack !== undefined ) {
114
  // all open children of open siblings
115
  anchor.parent().siblings().find(".mega-toggle-on").addBack().children("a").each(function() {
116
  plugin.hidePanel($(this), immediate);
@@ -139,16 +132,16 @@
139
  */
140
  plugin.hideOpenSiblings = function() {
141
  // desktops, horizontal
142
- if ( plugin.isDesktopView() && ( $menu.hasClass("mega-menu-horizontal") || $menu.hasClass("mega-menu-vertical") ) ) {
143
  return "immediately";
144
  }
145
 
146
  // mobile, keyboard navigation
147
- if ( ! plugin.isDesktopView() && $menu.hasClass("mega-keyboard-navigation") ) {
148
  return "animated";
149
  }
150
 
151
- if ( plugin.settings.vertical_behaviour === "accordion" ) {
152
  return "animated";
153
  }
154
 
@@ -160,7 +153,7 @@
160
  * Display a single panel. Also handles closing of panels that are currently open and need to be closed.
161
  */
162
  plugin.showPanel = function(anchor) {
163
- if ( !plugin.isDesktopView() && anchor.parent().hasClass("mega-hide-sub-menu-on-mobile") ) {
164
  return;
165
  }
166
 
@@ -175,7 +168,7 @@
175
  }
176
 
177
  // apply dynamic width and sub menu position
178
- if ( anchor.parent().hasClass("mega-menu-megamenu") && $(plugin.settings.panel_width).length ) {
179
  var submenu_offset = $menu.offset();
180
  var target_offset = $(plugin.settings.panel_width).offset();
181
 
@@ -186,10 +179,10 @@
186
  }
187
 
188
  // apply inner width to sub menu by adding padding to the left and right of the mega menu
189
- if ( anchor.parent().hasClass("mega-menu-megamenu") && plugin.settings.panel_inner_width && plugin.settings.panel_inner_width.length > 0 ) {
190
  var target_width = 0;
191
 
192
- if ( $(plugin.settings.panel_inner_width).length ) {
193
  // jQuery selector
194
  target_width = parseInt($(plugin.settings.panel_inner_width).width(), 10);
195
  } else {
@@ -199,7 +192,7 @@
199
 
200
  var submenu_width = parseInt(anchor.siblings(".mega-sub-menu").innerWidth(), 10);
201
 
202
- if ( (target_width > 0) && (target_width < submenu_width) ) {
203
  anchor.siblings(".mega-sub-menu").css({
204
  "paddingLeft": (submenu_width - target_width) / 2 + "px",
205
  "paddingRight": (submenu_width - target_width) / 2 + "px"
@@ -208,7 +201,7 @@
208
  }
209
 
210
  // apply jQuery transition (only if the effect is set to "slide", other transitions are CSS based)
211
- if ( megamenu.effect[plugin.settings.effect] ) {
212
  var effect = megamenu.effect[plugin.settings.effect]["in"];
213
  var speed = plugin.settings.effect_speed;
214
 
@@ -230,35 +223,35 @@
230
  /**
231
  * Open sub menus on click
232
  */
233
- var openOnClick = function() {
234
  // hide menu when clicked away from
235
- $(document).on("click touchstart", function(event) {
236
- if ( ( plugin.settings.document_click === "collapse" ) && ! $(event.target).closest(".mega-menu li").length && plugin.isDesktopView() ) {
237
  plugin.hideAllPanels();
238
  }
239
  });
240
 
241
- $("li.mega-menu-megamenu.mega-menu-item-has-children > a, li.mega-menu-flyout.mega-menu-item-has-children > a, li.mega-menu-flyout li.mega-menu-item-has-children > a", menu).on({
242
- click: function(e) {
243
- // all clicks on parent items when sub menu is hidden on mobile
244
- if ( ! plugin.isDesktopView() && $(this).parent().hasClass("mega-hide-sub-menu-on-mobile") ) {
245
- return;
246
- }
247
 
248
- // check for second click
249
- if ( plugin.settings.second_click === "go" || $(this).parent().hasClass("mega-click-click-go") ) {
250
- if ( ! $(this).parent().hasClass("mega-toggle-on") ) {
251
- e.preventDefault();
252
- plugin.showPanel($(this));
253
- }
254
- } else {
 
 
255
  e.preventDefault();
 
 
 
 
256
 
257
- if ( $(this).parent().hasClass("mega-toggle-on") ) {
258
- plugin.hidePanel($(this), false);
259
- } else {
260
- plugin.showPanel($(this));
261
- }
262
  }
263
  }
264
  });
@@ -268,24 +261,34 @@
268
  /**
269
  * Open sub menus on hover
270
  */
271
- var openOnHover = function() {
272
- $("li.mega-menu-item-has-children", menu).not("li.mega-menu-megamenu li.mega-menu-item-has-children", menu).hover(
273
- function() {
 
 
 
 
274
  plugin.showPanel($(this).children("a"));
275
- }, function() {
 
276
  if ($(this).hasClass("mega-toggle-on")) {
277
  plugin.hidePanel($(this).children("a"), false);
278
  }
279
  }
280
- );
281
  };
282
 
 
283
  /**
284
  * Open sub menus on hoverIntent
285
  */
286
- var openOnHoverIntent = function() {
287
  $("li.mega-menu-item-has-children", menu).not("li.mega-menu-megamenu li.mega-menu-item-has-children", menu).hoverIntent({
288
  over: function () {
 
 
 
 
289
  plugin.showPanel($(this).children("a"));
290
  },
291
  out: function () {
@@ -298,10 +301,18 @@
298
  });
299
  };
300
 
 
 
 
 
 
 
 
 
301
  /**
302
  * Handle keyboard navigation of the menu. Highlight focused items.
303
  */
304
- plugin.keyboard_navigation = function() {
305
  var tab_key = 9;
306
  var escape_key = 27;
307
 
@@ -345,7 +356,7 @@
345
  /**
346
  * Remove all events from mega menu
347
  */
348
- plugin.unbindEvents = function() {
349
  $("ul.mega-sub-menu, li.mega-menu-item, a.mega-menu-link", menu).unbind();
350
  };
351
 
@@ -354,14 +365,20 @@
354
  * Bind events to the menu items to allow it to be opened on click, hover or hover intent.
355
  * The event will always be "click" when a touch screen is detected, or the current view is "mobile"
356
  */
357
- plugin.bindEvents = function() {
358
- if (isTouchDevice() || plugin.settings.event === "click" || ! plugin.isDesktopView() ) {
359
- openOnClick();
360
- } else if (plugin.settings.event === "hover_intent") {
361
- openOnHoverIntent();
362
- } else {
363
- openOnHover();
 
 
364
  }
 
 
 
 
365
  };
366
 
367
 
@@ -400,6 +417,7 @@
400
  }
401
  };
402
 
 
403
  /**
404
  * Reverse right aligned menu items so that they appear in the same order on mobile as they do on desktop
405
  */
@@ -412,8 +430,8 @@
412
  * Called when the menu view loads in mobile, or switches from desktop to mobile
413
  */
414
  plugin.switchToMobile = function() {
415
- plugin.unbindEvents();
416
- plugin.bindEvents();
417
  plugin.reverseRightAlignedItems();
418
  };
419
 
@@ -422,8 +440,8 @@
422
  * Called when the menu view switches from mobile to desktop
423
  */
424
  plugin.switchToDesktop = function() {
425
- plugin.unbindEvents();
426
- plugin.bindEvents();
427
  plugin.reverseRightAlignedItems();
428
  };
429
 
@@ -446,10 +464,10 @@
446
  }
447
  });
448
 
449
- plugin.unbindEvents();
450
- plugin.bindEvents();
451
  plugin.monitorView();
452
- plugin.keyboard_navigation();
453
 
454
  $menu.triggerHandler("after_mega_menu_init");
455
 
28
 
29
  plugin.settings = {};
30
 
 
 
 
 
 
 
 
31
 
32
  /**
33
  * Hides a single panel (sub menu)
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
+
57
  anchor.siblings(".mega-sub-menu").each( function() {
58
+ plugin.addAnimatingClass(anchor.parent());
59
  });
60
  } else {
61
  anchor.parent().removeClass("mega-toggle-on").triggerHandler("close_panel");
62
+ plugin.addAnimatingClass(anchor.parent());
63
  }
64
  } else {
65
  anchor.parent().removeClass("mega-toggle-on").triggerHandler("close_panel");
66
+ plugin.addAnimatingClass(anchor.parent());
67
  }
68
 
69
  };
73
  * Adds an animating class to the sub menu whilst it is closing.
74
  * This allows the CSS3 animation to complete before the element is hidden.
75
  */
76
+ plugin.addAnimatingClass = function(element) {
77
  if (plugin.settings.effect === "disabled") {
78
  return;
79
  }
103
  */
104
  plugin.hideSiblingPanels = function(anchor, immediate) {
105
  // jQuery 1.7.2 compatibility for themes/plugins that load old versions of jQuery
106
+ if ($.fn.addBack !== undefined) {
107
  // all open children of open siblings
108
  anchor.parent().siblings().find(".mega-toggle-on").addBack().children("a").each(function() {
109
  plugin.hidePanel($(this), immediate);
132
  */
133
  plugin.hideOpenSiblings = function() {
134
  // desktops, horizontal
135
+ if (plugin.isDesktopView() && ($menu.hasClass("mega-menu-horizontal") || $menu.hasClass("mega-menu-vertical"))) {
136
  return "immediately";
137
  }
138
 
139
  // mobile, keyboard navigation
140
+ if (!plugin.isDesktopView() && $menu.hasClass("mega-keyboard-navigation")) {
141
  return "animated";
142
  }
143
 
144
+ if (plugin.settings.vertical_behaviour === "accordion") {
145
  return "animated";
146
  }
147
 
153
  * Display a single panel. Also handles closing of panels that are currently open and need to be closed.
154
  */
155
  plugin.showPanel = function(anchor) {
156
+ if (!plugin.isDesktopView() && anchor.parent().hasClass("mega-hide-sub-menu-on-mobile")) {
157
  return;
158
  }
159
 
168
  }
169
 
170
  // apply dynamic width and sub menu position
171
+ if (anchor.parent().hasClass("mega-menu-megamenu") && $(plugin.settings.panel_width).length) {
172
  var submenu_offset = $menu.offset();
173
  var target_offset = $(plugin.settings.panel_width).offset();
174
 
179
  }
180
 
181
  // apply inner width to sub menu by adding padding to the left and right of the mega menu
182
+ if (anchor.parent().hasClass("mega-menu-megamenu") && plugin.settings.panel_inner_width && plugin.settings.panel_inner_width.length > 0) {
183
  var target_width = 0;
184
 
185
+ if ($(plugin.settings.panel_inner_width).length) {
186
  // jQuery selector
187
  target_width = parseInt($(plugin.settings.panel_inner_width).width(), 10);
188
  } else {
192
 
193
  var submenu_width = parseInt(anchor.siblings(".mega-sub-menu").innerWidth(), 10);
194
 
195
+ if (target_width > 0 && target_width < submenu_width) {
196
  anchor.siblings(".mega-sub-menu").css({
197
  "paddingLeft": (submenu_width - target_width) / 2 + "px",
198
  "paddingRight": (submenu_width - target_width) / 2 + "px"
201
  }
202
 
203
  // apply jQuery transition (only if the effect is set to "slide", other transitions are CSS based)
204
+ if (megamenu.effect[plugin.settings.effect]) {
205
  var effect = megamenu.effect[plugin.settings.effect]["in"];
206
  var speed = plugin.settings.effect_speed;
207
 
223
  /**
224
  * Open sub menus on click
225
  */
226
+ var bindClickEvents = function() {
227
  // hide menu when clicked away from
228
+ $(document).on("click", function(e) {
229
+ if ((plugin.settings.document_click === "collapse" ) && ! $(e.target).closest(".mega-menu li").length && plugin.isDesktopView()) {
230
  plugin.hideAllPanels();
231
  }
232
  });
233
 
234
+ var items_with_submenus = $("li.mega-menu-megamenu.mega-menu-item-has-children > a.mega-menu-link, li.mega-menu-flyout.mega-menu-item-has-children > a.mega-menu-link, li.mega-menu-flyout li.mega-menu-item-has-children > a.mega-menu-link", menu);
 
 
 
 
 
235
 
236
+ items_with_submenus.on("click.megamenu touchstart.megamenu", function(e) {
237
+ // allow all clicks on parent items when sub menu is hidden on mobile
238
+ if (!plugin.isDesktopView() && $(this).parent().hasClass("mega-hide-sub-menu-on-mobile")) {
239
+ return;
240
+ }
241
+
242
+ // check for second click
243
+ if (plugin.settings.second_click === "go" || $(this).parent().hasClass("mega-click-click-go")) {
244
+ if (!$(this).parent().hasClass("mega-toggle-on")) {
245
  e.preventDefault();
246
+ plugin.showPanel($(this));
247
+ }
248
+ } else {
249
+ e.preventDefault();
250
 
251
+ if ($(this).parent().hasClass("mega-toggle-on")) {
252
+ plugin.hidePanel($(this), false);
253
+ } else {
254
+ plugin.showPanel($(this));
 
255
  }
256
  }
257
  });
261
  /**
262
  * Open sub menus on hover
263
  */
264
+ var bindHoverEvents = function() {
265
+ $("li.mega-menu-item-has-children", menu).not("li.mega-menu-megamenu li.mega-menu-item-has-children", menu).on({
266
+ mouseenter: function() {
267
+ if ($(this).hasClass('mega-animating')) {
268
+ return;
269
+ }
270
+ plugin.unbindClickEvents();
271
  plugin.showPanel($(this).children("a"));
272
+ },
273
+ mouseleave: function() {
274
  if ($(this).hasClass("mega-toggle-on")) {
275
  plugin.hidePanel($(this).children("a"), false);
276
  }
277
  }
278
+ });
279
  };
280
 
281
+
282
  /**
283
  * Open sub menus on hoverIntent
284
  */
285
+ var bindHoverIntentEvents = function() {
286
  $("li.mega-menu-item-has-children", menu).not("li.mega-menu-megamenu li.mega-menu-item-has-children", menu).hoverIntent({
287
  over: function () {
288
+ if ($(this).hasClass('mega-animating')) {
289
+ return;
290
+ }
291
+ plugin.unbindClickEvents();
292
  plugin.showPanel($(this).children("a"));
293
  },
294
  out: function () {
301
  });
302
  };
303
 
304
+
305
+ /**
306
+ *
307
+ */
308
+ plugin.unbindClickEvents = function() {
309
+ $("a.mega-menu-link").off("click.megamenu touchstart.megamenu");
310
+ }
311
+
312
  /**
313
  * Handle keyboard navigation of the menu. Highlight focused items.
314
  */
315
+ plugin.keyboardNavigation = function() {
316
  var tab_key = 9;
317
  var escape_key = 27;
318
 
356
  /**
357
  * Remove all events from mega menu
358
  */
359
+ plugin.unbindAllEvents = function() {
360
  $("ul.mega-sub-menu, li.mega-menu-item, a.mega-menu-link", menu).unbind();
361
  };
362
 
365
  * Bind events to the menu items to allow it to be opened on click, hover or hover intent.
366
  * The event will always be "click" when a touch screen is detected, or the current view is "mobile"
367
  */
368
+ plugin.bindMegaMenuEvents = function() {
369
+ if ( plugin.isDesktopView() ) {
370
+ if (plugin.settings.event === "hover_intent") {
371
+ bindHoverIntentEvents();
372
+ }
373
+
374
+ if (plugin.settings.event === "hover") {
375
+ bindHoverEvents();
376
+ }
377
  }
378
+
379
+ // always bind click events for touch screen devices
380
+ // click events will be unbound if a hover or hoverIntent event fires
381
+ bindClickEvents();
382
  };
383
 
384
 
417
  }
418
  };
419
 
420
+
421
  /**
422
  * Reverse right aligned menu items so that they appear in the same order on mobile as they do on desktop
423
  */
430
  * Called when the menu view loads in mobile, or switches from desktop to mobile
431
  */
432
  plugin.switchToMobile = function() {
433
+ plugin.unbindAllEvents();
434
+ plugin.bindMegaMenuEvents();
435
  plugin.reverseRightAlignedItems();
436
  };
437
 
440
  * Called when the menu view switches from mobile to desktop
441
  */
442
  plugin.switchToDesktop = function() {
443
+ plugin.unbindAllEvents();
444
+ plugin.bindMegaMenuEvents();
445
  plugin.reverseRightAlignedItems();
446
  };
447
 
464
  }
465
  });
466
 
467
+ plugin.unbindAllEvents();
468
+ plugin.bindMegaMenuEvents();
469
  plugin.monitorView();
470
+ plugin.keyboardNavigation();
471
 
472
  $menu.triggerHandler("after_mega_menu_init");
473
 
megamenu.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  * Plugin Name: Max Mega Menu
5
  * Plugin URI: https://www.maxmegamenu.com
6
- * Description: Mega Menu for WordPress.
7
  * Version: 2.2.3.1
8
  * Author: Tom Hemsley
9
  * Author URI: https://www.maxmegamenu.com
@@ -77,11 +77,6 @@ final class Mega_Menu {
77
 
78
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts'), 11 );
79
 
80
- // add 'go pro' link to plugin options
81
- $plugin = plugin_basename( __FILE__ );
82
-
83
- add_filter( "plugin_action_links_{$plugin}", array( $this, 'upgrade_to_pro_link' ) );
84
-
85
  add_shortcode( 'maxmenu', array( $this, 'register_shortcode' ) );
86
  add_shortcode( 'maxmegamenu', array( $this, 'register_shortcode' ) );
87
 
@@ -175,22 +170,6 @@ final class Mega_Menu {
175
  }
176
 
177
 
178
- /**
179
- * Add go pro link on plugin page
180
- *
181
- * @since 1.8.3
182
- */
183
- public function upgrade_to_pro_link( $links ) {
184
-
185
- if ( function_exists( 'is_plugin_active' ) && ! is_plugin_active( 'megamenu-pro/megamenu-pro.php' ) ) {
186
- $links[] = '<a href="https://www.maxmegamenu.com/upgrade/?utm_source=free&amp;utm_medium=link&amp;utm_campaign=pro" target="_blank"><b>' . __( "Go Pro", "megamenu" ) . '</b></a>';
187
- }
188
-
189
- return $links;
190
-
191
- }
192
-
193
-
194
  /**
195
  * Black Studio TinyMCE Compatibility.
196
  * Load TinyMCE assets on nav-menus.php page.
@@ -1009,4 +988,4 @@ if ( ! function_exists( 'max_mega_menu_is_enabled' ) ) {
1009
 
1010
  return is_array( $settings ) && isset( $settings[ $location ]['enabled'] ) && $settings[ $location ]['enabled'] == true;
1011
  }
1012
- }
3
  /*
4
  * Plugin Name: Max Mega Menu
5
  * Plugin URI: https://www.maxmegamenu.com
6
+ * Description: Easy to use drag & drop WordPress Mega Menu plugin. Create Mega Menus using Widgets. Responsive, retina & touch ready.
7
  * Version: 2.2.3.1
8
  * Author: Tom Hemsley
9
  * Author URI: https://www.maxmegamenu.com
77
 
78
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts'), 11 );
79
 
 
 
 
 
 
80
  add_shortcode( 'maxmenu', array( $this, 'register_shortcode' ) );
81
  add_shortcode( 'maxmegamenu', array( $this, 'register_shortcode' ) );
82
 
170
  }
171
 
172
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  /**
174
  * Black Studio TinyMCE Compatibility.
175
  * Load TinyMCE assets on nav-menus.php page.
988
 
989
  return is_array( $settings ) && isset( $settings[ $location ]['enabled'] ) && $settings[ $location ]['enabled'] == true;
990
  }
991
+ }
readme.txt CHANGED
@@ -97,6 +97,25 @@ See https://www.maxmegamenu.com for more screenshots
97
 
98
  == Changelog ==
99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  = 2.2.3.1 [23/08/2016] =
101
 
102
  * Fix: JavaScript fix for themes/plugins that force WordPress to load outdated versions of jQuery (CherryFramework)
97
 
98
  == Changelog ==
99
 
100
+ = 2.2.4 =
101
+
102
+ * New Feature: Light, Light Transparent and Dark Transparent menu themes added
103
+ * New Feature: "Hover" event (options are now Hover Intent, Hover or Click)
104
+ * Big Fix: Hover not working on some devices with touch screens. This has been tested for Hover, Hover Intent and Click on:
105
+ Mac FireFox/Safari/Chrome, Windows Edge/IE9/IE10/IE11/FireFox/Chrome, iPhone, iPad Chrome/Safari, Andoid Default/Chrome - a total of 42 combinations. If you have problems with touch or hover, please post in the support forums detailing exactly which Operating System, Browser and Event you are using so that I can reproduce the issue here.
106
+ * Fix: Sub menus reappear if hovered over as they're animating out
107
+ * Fix: Mobile menu now always switches to click, even on desktops
108
+ * Fix: Responsive Breakpoint validation
109
+ * Fix: Never hide sub menus on document click on mobile
110
+ * Fix: Remove margin from right aligned menu items on mobile
111
+ * Fix: Apply hover styling to current-page-ancestor
112
+ * Fix: Fix WPML cache clearing when CSS Output is set to Output in head
113
+ * Fix: Allow single quotes in theme editor custom CSS
114
+ * Fix: Allow single quotes in Menu Toggle toggle block text
115
+ * Fix: Improve theme editor settings validation
116
+ * Change: Remove permanent 'Go Pro' nag from Plugins page. Add dismissable nag in menu item settings.
117
+ * Change: Add mega-menu-location body class when MMM is enabled for a location to pave the way for automatic theme integration
118
+
119
  = 2.2.3.1 [23/08/2016] =
120
 
121
  * Fix: JavaScript fix for themes/plugins that force WordPress to load outdated versions of jQuery (CherryFramework)