wp_custom_menu - Version 2.5.2

Version Notes

+ submenu level3+

Download this release

Release Info

Developer WebAndPeople
Extension wp_custom_menu
Version 2.5.2
Comparing to
See all releases


Code changes from version 2.4.1 to 2.5.2

app/code/local/WP/CustomMenu/Block/Navigation.php CHANGED
@@ -11,6 +11,44 @@ class WP_CustomMenu_Block_Navigation extends Mage_Catalog_Block_Navigation
11
  return Mage::getStoreConfig('custom_menu/general/show_home_link');
12
  }
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  public function drawCustomMenuItem($category, $level = 0, $last = false)
15
  {
16
  if (!$category->getIsActive()) return '';
@@ -57,8 +95,9 @@ class WP_CustomMenu_Block_Navigation extends Mage_Catalog_Block_Navigation
57
  $html[] = '<div id="popup' . $id . '" class="wp-custom-menu-popup" onmouseout="wpHideMenuPopup(this, event, \'popup' . $id . '\', \'menu' . $id . '\')" onmouseover="wpPopupOver(this, event, \'popup' . $id . '\', \'menu' . $id . '\')">';
58
  // --- draw Sub Categories ---
59
  if (count($activeChildren)) {
 
60
  $html[] = '<div class="block1">';
61
- $html[] = $this->drawColumns($activeChildren);
62
  $html[] = '<div class="clearBoth"></div>';
63
  $html[] = '</div>';
64
  }
@@ -74,6 +113,42 @@ class WP_CustomMenu_Block_Navigation extends Mage_Catalog_Block_Navigation
74
  return $html;
75
  }
76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  public function drawMenuItem($children, $level = 1)
78
  {
79
  $html = '<div class="itemMenu level' . $level . '">';
@@ -107,11 +182,10 @@ class WP_CustomMenu_Block_Navigation extends Mage_Catalog_Block_Navigation
107
  return $html;
108
  }
109
 
110
- public function drawColumns($children)
111
  {
112
  $html = '';
113
  // --- explode by columns ---
114
- $columns = (int)Mage::getStoreConfig('custom_menu/columns/count');
115
  if ($columns < 1) $columns = 1;
116
  $chunks = $this->_explodeByColumns($children, $columns);
117
  // --- draw columns ---
11
  return Mage::getStoreConfig('custom_menu/general/show_home_link');
12
  }
13
 
14
+ public function drawCustomMenuMobileItem($category, $level = 0, $last = false)
15
+ {
16
+ if (!$category->getIsActive()) return '';
17
+ $html = array();
18
+ $id = $category->getId();
19
+ // --- Sub Categories ---
20
+ $activeChildren = $this->_getActiveChildren($category, $level);
21
+ // --- class for active category ---
22
+ $active = ''; if ($this->isCategoryActive($category)) $active = ' act';
23
+ $hasSubMenu = count($activeChildren);
24
+ $catUrl = $this->getCategoryUrl($category);
25
+ $html[] = '<div id="menu-mobile-' . $id . '" class="menu-mobile level0' . $active . '">';
26
+ $html[] = '<div class="parentMenu">';
27
+ // --- Top Menu Item ---
28
+ $html[] = '<a href="' . $catUrl .'">';
29
+ $name = $this->escapeHtml($category->getName());
30
+ if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) {
31
+ $name = str_replace(' ', '&nbsp;', $name);
32
+ }
33
+ $html[] = '<span>' . $name . '</span>';
34
+ $html[] = '</a>';
35
+ if ($hasSubMenu) {
36
+ $html[] = '<span class="button" rel="submenu-mobile-' . $id . '" onclick="wpSubMenuToggle(this, \'menu-mobile-' . $id . '\', \'submenu-mobile-' . $id . '\');">&nbsp</span>';
37
+ }
38
+ $html[] = '</div>';
39
+ // --- Add Popup block (hidden) ---
40
+ if ($hasSubMenu) {
41
+ // --- draw Sub Categories ---
42
+ $html[] = '<div id="submenu-mobile-' . $id . '" rel="level' . $level . '" class="wp-custom-menu-submenu" style="display: none;">';
43
+ $html[] = $this->drawMobileMenuItem($activeChildren);
44
+ $html[] = '<div class="clearBoth"></div>';
45
+ $html[] = '</div>';
46
+ }
47
+ $html[] = '</div>';
48
+ $html = implode("\n", $html);
49
+ return $html;
50
+ }
51
+
52
  public function drawCustomMenuItem($category, $level = 0, $last = false)
53
  {
54
  if (!$category->getIsActive()) return '';
95
  $html[] = '<div id="popup' . $id . '" class="wp-custom-menu-popup" onmouseout="wpHideMenuPopup(this, event, \'popup' . $id . '\', \'menu' . $id . '\')" onmouseover="wpPopupOver(this, event, \'popup' . $id . '\', \'menu' . $id . '\')">';
96
  // --- draw Sub Categories ---
97
  if (count($activeChildren)) {
98
+ $columns = (int)Mage::getStoreConfig('custom_menu/columns/count');
99
  $html[] = '<div class="block1">';
100
+ $html[] = $this->drawColumns($activeChildren, $columns);
101
  $html[] = '<div class="clearBoth"></div>';
102
  $html[] = '</div>';
103
  }
113
  return $html;
114
  }
115
 
116
+ public function drawMobileMenuItem($children, $level = 1)
117
+ {
118
+ $keyCurrent = $this->getCurrentCategory()->getId();
119
+ $html = '';
120
+ foreach ($children as $child) {
121
+ if (is_object($child) && $child->getIsActive()) {
122
+ // --- class for active category ---
123
+ $active = '';
124
+ $id = $child->getId();
125
+ $activeChildren = $this->_getActiveChildren($child, $level);
126
+ if ($this->isCategoryActive($child)) {
127
+ $active = ' actParent';
128
+ if ($id == $keyCurrent) $active = ' act';
129
+ }
130
+ $html.= '<div id="menu-mobile-' . $id . '" class="itemMenu level' . $level . $active . '">';
131
+ // --- format category name ---
132
+ $name = $this->escapeHtml($child->getName());
133
+ if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) $name = str_replace(' ', '&nbsp;', $name);
134
+ $html.= '<div class="parentMenu">';
135
+ $html.= '<a class="itemMenuName level' . $level . '" href="' . $this->getCategoryUrl($child) . '"><span>' . $name . '</span></a>';
136
+ if (count($activeChildren) > 0) {
137
+ $html.= '<span class="button" rel="submenu-mobile-' . $id . '" onclick="wpSubMenuToggle(this, \'menu-mobile-' . $id . '\', \'submenu-mobile-' . $id . '\');">&nbsp</span>';
138
+ }
139
+ $html.= '</div>';
140
+ if (count($activeChildren) > 0) {
141
+ $html.= '<div id="submenu-mobile-' . $id . '" rel="level' . $level . '" class="wp-custom-menu-submenu level' . $level . '" style="display: none;">';
142
+ $html.= $this->drawMobileMenuItem($activeChildren, $level + 1);
143
+ $html.= '<div class="clearBoth"></div>';
144
+ $html.= '</div>';
145
+ }
146
+ $html.= '</div>';
147
+ }
148
+ }
149
+ return $html;
150
+ }
151
+
152
  public function drawMenuItem($children, $level = 1)
153
  {
154
  $html = '<div class="itemMenu level' . $level . '">';
182
  return $html;
183
  }
184
 
185
+ public function drawColumns($children, $columns = 1)
186
  {
187
  $html = '';
188
  // --- explode by columns ---
 
189
  if ($columns < 1) $columns = 1;
190
  $chunks = $this->_explodeByColumns($children, $columns);
191
  // --- draw columns ---
app/code/local/WP/CustomMenu/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <WP_CustomMenu>
5
- <version>2.4.1</version>
6
  </WP_CustomMenu>
7
  </modules>
8
  <frontend>
@@ -73,7 +73,7 @@
73
  <non_breaking_space>0</non_breaking_space>
74
  <ie6_ignore>1</ie6_ignore>
75
  <rtl>0</rtl>
76
- <version>2.4.1</version>
77
  </general>
78
  <columns>
79
  <count>3</count>
2
  <config>
3
  <modules>
4
  <WP_CustomMenu>
5
+ <version>2.5.2</version>
6
  </WP_CustomMenu>
7
  </modules>
8
  <frontend>
73
  <non_breaking_space>0</non_breaking_space>
74
  <ie6_ignore>1</ie6_ignore>
75
  <rtl>0</rtl>
76
+ <version>2.5.2</version>
77
  </general>
78
  <columns>
79
  <count>3</count>
app/design/frontend/default/default/template/webandpeople/custommenu/top.phtml CHANGED
@@ -19,6 +19,28 @@
19
  <?php endforeach ?>
20
  <div class="clearBoth"></div>
21
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  </div>
23
  <script type="text/javascript">
24
  //<![CDATA[
@@ -30,5 +52,6 @@ var CUSTOMMENU_RTL_MODE = <?php echo $_rtl; ?>;
30
  var wpCustommenuTimerShow = {};
31
  var wpCustommenuTimerHide = {};
32
  var wpActiveMenu = null;
 
33
  //]]>
34
  </script>
19
  <?php endforeach ?>
20
  <div class="clearBoth"></div>
21
  </div>
22
+ <div id="custommenu-mobile" class="<?php echo $_rtl ? ' rtl' : ''; ?>" style="display:none;">
23
+ <div id="menu-button" onclick="wpMenuButtonToggle()">
24
+ <a href="javascript:void(0);">
25
+ <span>Menu</span>
26
+ </a>
27
+ </div>
28
+ <div id="menu-content" style="display:none;">
29
+ <?php if ($this->showHomeLink()) : ?>
30
+ <div id="menu-mobile-0" class="menu-mobile level0">
31
+ <div class="parentMenu">
32
+ <a href="<?php echo $this->getUrl('') ?>">
33
+ <span><?php echo $this->__('Home'); ?></span>
34
+ </a>
35
+ </div>
36
+ </div>
37
+ <?php endif ?>
38
+ <?php foreach ($_categories as $_category): ?>
39
+ <?php echo $this->drawCustomMenuMobileItem($_category) ?>
40
+ <?php endforeach ?>
41
+ <div class="clearBoth"></div>
42
+ </div>
43
+ </div>
44
  </div>
45
  <script type="text/javascript">
46
  //<![CDATA[
52
  var wpCustommenuTimerShow = {};
53
  var wpCustommenuTimerHide = {};
54
  var wpActiveMenu = null;
55
+ wpCustomMenuMobileToggle();
56
  //]]>
57
  </script>
package.xml CHANGED
@@ -1,14 +1,14 @@
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <package>
3
  <name>wp_custom_menu</name>
4
- <version>2.4.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported License</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Magento Extension - Magento Custom Menu (Web-Experiment.Info)</summary>
10
  <description>Magento Extension - Magento Custom Menu (Web-Experiment.Info)</description>
11
- <notes>~ detection id to display a static block</notes>
12
  <authors>
13
  <author>
14
  <name>WebAndPeople</name>
@@ -21,8 +21,8 @@
21
  <email>y.gerassimenko@webandpeople.com</email>
22
  </author>
23
  </authors>
24
- <date>2013-05-28</date>
25
- <time>23:31:06</time>
26
  <contents>
27
  <target name="mageweb">
28
  <dir name="app">
@@ -32,7 +32,7 @@
32
  <dir name="CustomMenu">
33
  <dir name="Block">
34
  <file name="About.php" hash="c7770064d9bbd15f841b8f8d65aafe19"/>
35
- <file name="Navigation.php" hash="d9098519e18f957b9759bb32dcdf5010"/>
36
  <file name="Toggle.php" hash="b280abeb27613c14139a0f590048fcc7"/>
37
  <file name="Topmenu.php" hash="7102b3bf0473dc5ecb0d66c12bfc6a95"/>
38
  </dir>
@@ -40,7 +40,7 @@
40
  <file name="Data.php" hash="2e4bf439248df62e7936b59ba31994cc"/>
41
  </dir>
42
  <dir name="etc">
43
- <file name="config.xml" hash="09a84b04104c8fc3831f0bb8d211300f"/>
44
  <file name="system.xml" hash="c02e8881469bdb4fb5341fba2ef5d1a2"/>
45
  </dir>
46
  </dir>
@@ -59,7 +59,7 @@
59
  <dir name="template">
60
  <dir name="webandpeople">
61
  <dir name="custommenu">
62
- <file name="top.phtml" hash="7ef0543e00d047e00683bc449fc77f6f"/>
63
  </dir>
64
  </dir>
65
  </dir>
@@ -80,14 +80,14 @@
80
  <dir name="css">
81
  <dir name="webandpeople">
82
  <dir name="custommenu">
83
- <file name="custommenu.css" hash="679d419acd6e2de8a4358c1850926f6c"/>
84
  </dir>
85
  </dir>
86
  </dir>
87
  <dir name="js">
88
  <dir name="webandpeople">
89
  <dir name="custommenu">
90
- <file name="custommenu.js" hash="5b19bc1102e0e84a8efd41866d1acd0b"/>
91
  </dir>
92
  </dir>
93
  </dir>
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <package>
3
  <name>wp_custom_menu</name>
4
+ <version>2.5.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported License</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Magento Extension - Magento Custom Menu (Web-Experiment.Info)</summary>
10
  <description>Magento Extension - Magento Custom Menu (Web-Experiment.Info)</description>
11
+ <notes>+ submenu level3+</notes>
12
  <authors>
13
  <author>
14
  <name>WebAndPeople</name>
21
  <email>y.gerassimenko@webandpeople.com</email>
22
  </author>
23
  </authors>
24
+ <date>2013-07-05</date>
25
+ <time>11:29:07</time>
26
  <contents>
27
  <target name="mageweb">
28
  <dir name="app">
32
  <dir name="CustomMenu">
33
  <dir name="Block">
34
  <file name="About.php" hash="c7770064d9bbd15f841b8f8d65aafe19"/>
35
+ <file name="Navigation.php" hash="2bcf08eaf590fdc87596fa8c0bfa8b1a"/>
36
  <file name="Toggle.php" hash="b280abeb27613c14139a0f590048fcc7"/>
37
  <file name="Topmenu.php" hash="7102b3bf0473dc5ecb0d66c12bfc6a95"/>
38
  </dir>
40
  <file name="Data.php" hash="2e4bf439248df62e7936b59ba31994cc"/>
41
  </dir>
42
  <dir name="etc">
43
+ <file name="config.xml" hash="ecb8b5ddec0a5e557cf785fb444ad295"/>
44
  <file name="system.xml" hash="c02e8881469bdb4fb5341fba2ef5d1a2"/>
45
  </dir>
46
  </dir>
59
  <dir name="template">
60
  <dir name="webandpeople">
61
  <dir name="custommenu">
62
+ <file name="top.phtml" hash="1cf5fda0722c071a0f609e7c17229f03"/>
63
  </dir>
64
  </dir>
65
  </dir>
80
  <dir name="css">
81
  <dir name="webandpeople">
82
  <dir name="custommenu">
83
+ <file name="custommenu.css" hash="1502d73576a6c565ec27b565a2de2778"/>
84
  </dir>
85
  </dir>
86
  </dir>
87
  <dir name="js">
88
  <dir name="webandpeople">
89
  <dir name="custommenu">
90
+ <file name="custommenu.js" hash="37f1edab08663a982f5e13ea87fa990a"/>
91
  </dir>
92
  </dir>
93
  </dir>
skin/frontend/default/default/css/webandpeople/custommenu/custommenu.css CHANGED
@@ -1,55 +1,396 @@
1
- #custommenu {
2
- position:relative;
3
- font-size: 14px;
4
- margin: 0 auto;
5
- padding: 0 16px;
6
- width: 918px;
7
- z-index: 999;
8
- }
9
- div.menu {
10
- float: left;
11
- }
12
- div.menu.act {
13
- background-color:#ADD8E6;
14
- }
15
- div.menu.active {
16
- background-color:#FFC0CB;
17
- }
18
- div.wp-custom-menu-popup {
19
- position:absolute;
20
- z-index:3000;
21
- border:5px solid #FFC0CB;
22
- display: none;
23
- background-color:#fff;
24
- text-align:left;
25
- }
26
- div.menu, div.wp-custom-menu-popup {
27
- padding: 5px 12px 6px 8px;
28
- }
29
- div.menu a, div.wp-custom-menu-popup a {
30
- text-decoration: none;
31
- display:block;
32
- }
33
- div.wp-custom-menu-popup a.actParent {
34
- color: #4D4D4D;
35
- }
36
- div.wp-custom-menu-popup a.act {
37
- color: #A52A2A;
38
- }
39
- div.column {
40
- float:left;
41
- width:200px; /* column width */
42
- padding:5px;
43
- }
44
- div.itemSubMenu {
45
- margin-left:20px;
46
- }
47
- .clearBoth {
48
- clear:both;
49
- }
50
- #custommenu.rtl .menu {
51
- float: right;
52
- }
53
- #custommenu.rtl div.column {
54
- text-align: right;
55
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #custommenu {
2
+ position: relative;
3
+ font-size: 12px;
4
+ padding: 0px 0px 0px 0px;
5
+ width: 100%;
6
+ border-radius: 2px;
7
+ height: auto;
8
+ margin: 0 auto;
9
+ }
10
+ /*IE7 fix*/
11
+ *:first-child+html #custommenu {
12
+ z-index: 998;
13
+ }
14
+ div.menu {
15
+ float: left;
16
+ padding: 0px 0px 0px 0px;
17
+ margin: 0px 0px 0px 0px;
18
+ }
19
+ div.menu a:link, div.menu a:visited {
20
+ display: block;
21
+ height: 40px;
22
+ padding-left: 15px;
23
+ padding-right: 15px;
24
+ }
25
+ div.menu a span {
26
+ display: block;
27
+ height: 28px;
28
+ padding-right: 0px;
29
+ padding-top: 12px;
30
+ }
31
+ div.menu a span:hover {
32
+ cursor: pointer;
33
+ }
34
+ div.wp-custom-menu-popup {
35
+ position: absolute;
36
+ z-index: 1000;
37
+ display: none;
38
+ text-align: left;
39
+ padding: 0px 0px 10px 0px;
40
+ border-top: 0;
41
+ width: 100%;
42
+ margin-top: -1px;
43
+ }
44
+ div.menu a, div.wp-custom-menu-popup a {
45
+ text-decoration: none;
46
+ display:block;
47
+ cursor: pointer;
48
+ _height: 0;
49
+ height: auto;
50
+ line-height:13px;
51
+ }
52
+ div.level1 {
53
+ margin-bottom: 5px;
54
+ }
55
+ div.level2 {
56
+ margin-bottom: 5px;
57
+ }
58
+ div.level3 {
59
+ margin-bottom: 5px;
60
+ padding: 5px;
61
+ }
62
+ div.block2 {
63
+ padding-top: 0px;
64
+ padding-left: 10px;
65
+ padding-right: 10px;
66
+ display: block;
67
+ }
68
+ a.level1:link, a.level1:visited {
69
+ margin-top: 10px;
70
+ margin-bottom: 10px;
71
+ padding: 5px 10px;
72
+ border-radius: 2px;
73
+ }
74
+ a.level2:link, a.level2:visited {
75
+ padding: 3px 10px;
76
+ border-radius: 2px;
77
+ }
78
+ /* Clearfix */
79
+ div.block2:after {
80
+ content: ".";
81
+ display: block;
82
+ clear: both;
83
+ visibility: hidden;
84
+ line-height: 0;
85
+ height: 0;
86
+ }
87
+ html[xmlns] div.block2 {
88
+ display: block;
89
+ }
90
+ * html div.block2 {
91
+ height: 1%;
92
+ }
93
+ div.block2 p {
94
+ margin-bottom: 3px;
95
+ line-height: 120%;
96
+ color: #000;
97
+ font-size: 11px;
98
+ }
99
+ div.block2 p a {
100
+ display: inline;
101
+ }
102
+ div.block2 a img {
103
+ opacity: .9;
104
+ filter: alpha(opacity=90);
105
+ }
106
+ div.block2 a:hover img {
107
+ opacity: 1;
108
+ filter: alpha(opacity=100);
109
+ -webkit-transition: all .2s ease-in-out;
110
+ -moz-transition: all .2s ease-in-out;
111
+ -ms-transition: all .2s ease-in-out;
112
+ transition: all .2s ease-in-out;
113
+ }
114
+ div.block2 .brand a:hover img {
115
+ -webkit-transition: all 0;
116
+ -moz-transition: all 0;
117
+ -ms-transition: all 0;
118
+ transition: all 0;
119
+ }
120
+ div.wp-custom-menu-popup hr {
121
+ margin: 0px 0px 10px 0px;
122
+ }
123
+ /******************************************* COLUMN WIDTH ***************************** */
124
+ div.column {
125
+ float: left;
126
+ width: 18%; /* for 5 columns*/
127
+ padding: 0px 1%;
128
+ margin: 0px 0px 0px 0px;
129
+ }
130
+ /*end COLUMN WIDTH */
131
+
132
+ div.itemSubMenu {
133
+ margin-left: 0px;
134
+ }
135
+ .clearBoth {
136
+ clear:both;
137
+ height: 0;
138
+ overflow: hidden;
139
+ }
140
+ div.level1 {
141
+ margin-bottom: 0px;
142
+ }
143
+ /*BG*/
144
+ #custommenu {
145
+ }
146
+ div.wp-custom-menu-popup {
147
+ background: #f1f1f1;
148
+ box-shadow: 0px 15px 15px rgba(0, 0, 0, 0.3);
149
+ }
150
+ div.menu a:link, div.menu a:visited {
151
+ }
152
+ div.menu a:hover {
153
+ background: #f1f1f1;
154
+ }
155
+ div.menu a, div.wp-custom-menu-popup a {
156
+ -webkit-transition: all .1s linear;
157
+ -moz-transition: all .1s linear;
158
+ -ms-transition: all .1s linear;
159
+ transition: all .1s linear;
160
+ }
161
+ div.menu .brand a, div.wp-custom-menu-popup .brand a {
162
+ -webkit-transition: all 0s linear;
163
+ -moz-transition: all 0s linear;
164
+ -ms-transition: all 0s linear;
165
+ transition: all 0s linear;
166
+ }
167
+ div.menu.active a {
168
+ background: #f1f1f1 !important;
169
+ color: #000 !important;
170
+ }
171
+ div.level3 {
172
+ background: #fff;
173
+ }
174
+ /*FONTS*/
175
+ div.menu {
176
+ font-weight: normal;
177
+ font-size: 14px;
178
+ text-transform: uppercase;
179
+ font-family: "Segoe UI";
180
+ }
181
+ a.level1:link, a.level1:visited {
182
+ text-transform: none;
183
+ font-weight: normal;
184
+ }
185
+ a.level2:link, a.level2:visited {
186
+ font-weight: normal;
187
+ font-size: 13px;
188
+ line-height: 16px;
189
+ }
190
+ a.level3:link, a.level3:visited {
191
+ font-size: 11px;
192
+ font-weight: normal;
193
+ line-height: 100%;
194
+ margin-bottom: 0px;
195
+ }
196
+ /*COLOR*/
197
+ div.menu a:link, div.menu a:visited {
198
+ color: #fff;
199
+ }
200
+ div.menu a:hover, div.menu.active a {
201
+ color: #000;
202
+ }
203
+ a.level3:link, a.level3:visited {
204
+ color: #333333;
205
+ }
206
+ a.level3:hover {
207
+ color: #b43f74;
208
+ }
209
+ a.level2:link, a.level2:visited {
210
+ color: #000;
211
+ }
212
+ a.level1:hover {
213
+ background: #d3d3d3;
214
+ }
215
+ a.level2:hover {
216
+ color: #000;
217
+ background: #d3d3d3;
218
+ }
219
+ .block2 table.brand {
220
+ float: left;
221
+ }
222
+ .block2 .single_menu_product {
223
+ float: left;
224
+ position: relative;
225
+ max-width: 150px;
226
+ overflow: hidden;
227
+ margin-right: 20px;
228
+ margin-left: 0px;
229
+ }
230
+ /*MOBILE MENU STYLES*/
231
+ #menu-button, .parentMenu {
232
+ display: inline-block;
233
+ }
234
+ html[xmlns] #menu-button, html[xmlns] .parentMenu {
235
+ display: block;
236
+ }
237
+ * html #menu-button, * html .parentMenu {
238
+ height: 1%;
239
+ }
240
+ #menu-button:after, .parentMenu:after {
241
+ content: ".";
242
+ display: block;
243
+ clear: both;
244
+ visibility: hidden;
245
+ line-height: 0;
246
+ height: 0;
247
+ }
248
+ #custommenu-mobile {
249
+ position:relative;
250
+ margin: 0 auto;
251
+ padding: 0;
252
+ z-index: 999;
253
+ }
254
+ #menu-button {
255
+ float: none;
256
+ padding: 10px 0px 10px 0px;
257
+ margin: 0px 0px 0px 0px;
258
+ width: 100%;
259
+ border-bottom: 1px solid #fff;
260
+ text-transform: uppercase;
261
+ }
262
+ #menu-button a:link, #menu-button a:visited {
263
+ color: #fff;
264
+ display: block;
265
+ float: left;
266
+ margin-left: 45%;
267
+ position: relative;
268
+ padding: 0px 10px;
269
+ }
270
+ #menu-button a span:after {
271
+ display: block;
272
+ position: relative;
273
+ content: "";
274
+ width: 0;
275
+ height: 0;
276
+ border-left: 5px solid transparent;
277
+ border-right: 5px solid transparent;
278
+ border-top: 4px solid #dadada;
279
+ margin: 8px 0px 0px 5px;
280
+ float: right;
281
+ opacity: 0.7;
282
+ }
283
+ #menu-button:hover {
284
+ cursor: pointer;
285
+ }
286
+ #menu-button:hover a:after {
287
+ opacity: 1;
288
+ }
289
+ .menu-mobile div.column {
290
+ float:none;
291
+ padding:5px;
292
+ background: #fff;
293
+ }
294
+ .menu-mobile a.itemMenuName {
295
+ display: block;
296
+ text-align: left;
297
+ }
298
+ .menu-mobile div.menu-button, .menu-mobile div.menu-mobile {
299
+ float: none;
300
+ padding: 0px 0px 0px 0px;
301
+ margin: 0px 0px 0px 0px;
302
+ width: 100%;
303
+ border-bottom: 1px solid #fff;
304
+ }
305
+ .menu-mobile div.column {
306
+ float: none;
307
+ width: 100%;
308
+ padding: 0px 0;
309
+ margin: 0px 0px 0px 0px;
310
+ }
311
+ .menu-mobile a.level1:link, .menu-mobile a.level1:visited {
312
+ margin-top: 0px;
313
+ margin-bottom: 0;
314
+ padding: 10px 10px;
315
+ border-radius: 2px;
316
+ color: #000;
317
+ }
318
+ .menu-mobile a.level2:link, .menu-mobile a.level2:visited {
319
+ padding: 10px 10px;
320
+ border-radius: 2px;
321
+ }
322
+ .menu-mobile a.level1:link, .menu-mobile a.level1:visited {
323
+ color: #555;
324
+ }
325
+ .menu-mobile a.level1:hover {
326
+ background-color: #f1f1f1;
327
+ }
328
+ .menu-mobile .parent {
329
+ background-color: #fff;
330
+ }
331
+ /*buttons level 01*/
332
+ .menu-mobile .parentMenu {
333
+ padding: 0px 0px;
334
+ display: block;
335
+ text-align: left;
336
+ border-bottom: 1px solid #dadada;
337
+ }
338
+ .menu-mobile .parentMenu a:link, .menu-mobile .parentMenu a:visited {
339
+ padding: 10px 0px 10px 10px;
340
+ margin-right: 80px;
341
+ color: #000;
342
+ display: block;
343
+ }
344
+ .menu-mobile .parentMenu:hover {
345
+ cursor: pointer;
346
+ }
347
+ .parentMenu {
348
+ position: relative;
349
+ }
350
+ .parentMenu a {
351
+ display: block;
352
+ }
353
+ #menu-button {
354
+ cursor: pointer;
355
+ }
356
+ .menu-mobile div.level2 {
357
+ margin-bottom: 0;
358
+ }
359
+ #custommenu-mobile .button {
360
+ cursor: pointer;
361
+ position: absolute;
362
+ right: 1%;
363
+ top: 0px;
364
+ display: block;
365
+ width: 80px;
366
+ height: 38px;
367
+ background-color: transparent;
368
+ background-repeat: no-repeat;
369
+ background-position: 90% 50%;
370
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJxJREFUeNpi/P//PwM66O3tBVF1UNwEwsXFxRjqmBhwg3wgZobSWAE+zcxoNEmaCQKKNDP29PTgkvsAxPxA/BGIBXDZ3A7Ef4D4Pxrmh6rhxyL3E4gbQZqL8AUKDsAG0gfS3AfEf0nU/AuIJ4I0VwIxC8j/aPgjVOFHLHLsQFzDiCeFoQQYqSmMtvGMT/NfNJokzQug9HRcCgACDAC34CnSSWx3zwAAAABJRU5ErkJggg==);
371
+ }
372
+ #custommenu-mobile .button.open {
373
+ background-color: transparent;
374
+ background-repeat: no-repeat;
375
+ background-position: 90% 50%;
376
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAE5JREFUeNpi/P//PwO5gImBAjBENbP09vZSZHM7EP8B4v8k4J9A3AjSXATEzCRaygbSB9LcB8R/SdT8C4gnsgCJSigmGTCOpjDSAECAAQBI6RqpQRaDFgAAAABJRU5ErkJggg==);
377
+ }
378
+ #custommenu-mobile .level1 .button {
379
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIxJREFUeNpi/P//PwO5gAWbYG9vL4ZYcXExhhgTAwUAn+YJQAzyUxcuBYwwP2Nx6k8gZgPid0AsjM0L+Gxmg9LMxDob5lTkKOBHEuvCpzmZQBgl4NNcD8SvcWgEiTfhi+c+KGZAcvpHIBbAG9pYEglKaJOaSCqB+BrUK8QnTyxeYCDa2dRIngQBQIABAGG6KfxEmzSnAAAAAElFTkSuQmCC);
380
+ }
381
+ #custommenu-mobile .level1 .button.open {
382
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAE1JREFUeNpi/P//PwO5gImBAjBwmllgjN7eXqI1FRcXU9/ZE4D4Px7chU9zMgHLEvBprgfi1zg0gsSbsAYYFPRBMVGAcQSmMIo0AwQYAIYUFeQ3G04OAAAAAElFTkSuQmCC);
383
+ }
384
+ /*BG*/
385
+ #custommenu-mobile .parentMenu:hover a:link, #custommenu-mobile .parentMenu:hover a:visited, #custommenu-mobile .parentMenu:hover {
386
+ background-color: #fff;
387
+ }
388
+ #custommenu-mobile .level0 {
389
+ background-color: #f1f1f1;
390
+ }
391
+ #custommenu-mobile .level1 {
392
+ background-color: #e4e4e4;
393
+ }
394
+ #custommenu-mobile .level2 {
395
+ background-color: #f1f1f1;
396
+ }
skin/frontend/default/default/js/webandpeople/custommenu/custommenu.js CHANGED
@@ -133,20 +133,108 @@ function getCurrentMouseTarget(xEvent)
133
  }
134
  return wpCurrentMouseTarget;
135
  }
136
- /*
137
- Event.observe(document, 'click', function (event) {
138
- if (!!wpActiveMenu) {
139
- var element = event.element();
140
- if (!!element) {
141
- var menuObj = $(wpActiveMenu.menuId);
142
- var popupObj = $(wpActiveMenu.popupId);
143
- if (!wpIsChildOf(menuObj, element) && menuObj != element) {
144
- if (!wpIsChildOf(popupObj, element) && popupObj != element) {
145
- wpHideMenuPopup(element, event, wpActiveMenu.popupId, wpActiveMenu.menuId);
146
- wpActiveMenu = null;
147
- }
148
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  }
 
 
 
 
 
 
 
 
150
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  });
152
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  }
134
  return wpCurrentMouseTarget;
135
  }
136
+
137
+ function getCurrentMouseTargetMobile(xEvent)
138
+ {
139
+ if (!xEvent) var xEvent = window.event;
140
+ var wpCurrentMouseTarget = null;
141
+ if (xEvent.target) wpCurrentMouseTarget = xEvent.target;
142
+ else if (xEvent.srcElement) wpCurrentMouseTarget = xEvent.srcElement;
143
+ if (wpCurrentMouseTarget.nodeType == 3) // defeat Safari bug
144
+ wpCurrentMouseTarget = wpCurrentMouseTarget.parentNode;
145
+ return wpCurrentMouseTarget;
146
+ }
147
+
148
+ /* Mobile */
149
+ function wpMenuButtonToggle()
150
+ {
151
+ $('menu-content').toggle();
152
+ }
153
+
154
+ function wpGetMobileSubMenuLevel(id)
155
+ {
156
+ var rel = $(id).readAttribute('rel');
157
+ return parseInt(rel.replace('level', ''));
158
+ }
159
+
160
+ function wpSubMenuToggle(obj, activeMenuId, activeSubMenuId)
161
+ {
162
+ var currLevel = wpGetMobileSubMenuLevel(activeSubMenuId);
163
+ // --- hide submenus ---
164
+ $$('.wp-custom-menu-submenu').each(function(item) {
165
+ if (item.id == activeSubMenuId) return;
166
+ var xLevel = wpGetMobileSubMenuLevel(item.id);
167
+ if (xLevel >= currLevel) {
168
+ $(item).hide();
169
+ }
170
+ });
171
+ // --- reset button state ---
172
+ $('custommenu-mobile').select('span.button').each(function(xItem) {
173
+ var subMenuId = $(xItem).readAttribute('rel');
174
+ if (!$(subMenuId).visible()) {
175
+ $(xItem).removeClassName('open');
176
  }
177
+ });
178
+ // ---
179
+ if ($(activeSubMenuId).getStyle('display') == 'none') {
180
+ $(activeSubMenuId).show();
181
+ $(obj).addClassName('open');
182
+ } else {
183
+ $(activeSubMenuId).hide();
184
+ $(obj).removeClassName('open');
185
  }
186
+ }
187
+
188
+ function wpResetMobileMenuState()
189
+ {
190
+ $('menu-content').hide();
191
+ $$('.wp-custom-menu-submenu').each(function(item) {
192
+ $(item).hide();
193
+ });
194
+ $('custommenu-mobile').select('span.button').each(function(item) {
195
+ $(item).removeClassName('open');
196
+ });
197
+ }
198
+
199
+ function wpCustomMenuMobileToggle()
200
+ {
201
+ var w = window,
202
+ d = document,
203
+ e = d.documentElement,
204
+ g = d.getElementsByTagName('body')[0],
205
+ x = w.innerWidth || e.clientWidth || g.clientWidth,
206
+ y = w.innerHeight|| e.clientHeight|| g.clientHeight;
207
+ if (x < 800 || wpIsMobile.any()) {
208
+ $('custommenu').hide();
209
+ $('custommenu-mobile').show();
210
+ } else {
211
+ $('custommenu-mobile').hide();
212
+ wpResetMobileMenuState();
213
+ $('custommenu').show();
214
+ }
215
+ }
216
+
217
+ Event.observe(window, 'resize', function() {
218
+ wpCustomMenuMobileToggle();
219
  });
220
+
221
+ var wpIsMobile = {
222
+ Android: function() {
223
+ return navigator.userAgent.match(/Android/i);
224
+ },
225
+ BlackBerry: function() {
226
+ return navigator.userAgent.match(/BlackBerry/i);
227
+ },
228
+ iOS: function() {
229
+ return navigator.userAgent.match(/iPhone|iPad|iPod/i);
230
+ },
231
+ Opera: function() {
232
+ return navigator.userAgent.match(/Opera Mini/i);
233
+ },
234
+ Windows: function() {
235
+ return navigator.userAgent.match(/IEMobile/i);
236
+ },
237
+ any: function() {
238
+ return (wpIsMobile.Android() || wpIsMobile.BlackBerry() || wpIsMobile.iOS() || wpIsMobile.Opera() || wpIsMobile.Windows());
239
+ }
240
+ };