Skip to content

Commit

Permalink
Remove onmouseover/onmouseout from adminhtml menu (OpenMage#2737)
Browse files Browse the repository at this point in the history
Co-authored-by: Fabrizio Balliano <fabrizio.balliano@gmail.com>
  • Loading branch information
luigifab and fballiano committed Jul 15, 2023
1 parent 49951c1 commit 19048e0
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 44 deletions.
3 changes: 1 addition & 2 deletions app/code/core/Mage/Adminhtml/Block/Page/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,7 @@ public function getMenuLevel($menu, $level = 0)
if ((empty($item['url']) || ($item['url'] == '#')) && empty($item['children'])) {
continue; // for example hide System/Tools when empty
}
$html .= '<li ' . (!empty($item['children']) ? 'onmouseover="Element.addClassName(this,\'over\')" '
. 'onmouseout="Element.removeClassName(this,\'over\')"' : '') . ' class="'
$html .= '<li class="'
. (!$level && !empty($item['active']) ? ' active' : '') . ' '
. (!empty($item['children']) ? ' parent' : '')
. (!empty($level) && !empty($item['last']) ? ' last' : '')
Expand Down
21 changes: 11 additions & 10 deletions skin/adminhtml/default/default/menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/************** ALL LEVELS *************/ /* Style consistent throughout all nav levels */
#nav li { position:relative; text-align:left; }
#nav li.over { z-index:999; }
#nav li:hover { z-index:999; }
#nav li.active { z-index:1000; } /* to prevent the li separator from showing through on mouseover on li */
#nav a,
#nav a:hover { display:block; text-decoration:none; }
Expand All @@ -31,16 +31,16 @@
#nav li.active { margin-left:-1px; background:url(images/nav1_active.gif) no-repeat; color:#fff; font-weight:bold; }
#nav li.active em { display:block; position:absolute; top:0; right:-1px; width:3px; height:27px; background:url(images/nav1_active.gif) no-repeat 100% 0; }
#nav a { float:left; padding:0 14px; color:#fff; line-height:27px; }
#nav li.over a { color:#d6e2e5; }
#nav li:hover a { color:#d6e2e5; }


/************ 1ST LEVEL RESET ************/
#nav ul li,
#nav ul li.active { float:none; height:auto; background:none; margin:0; }
#nav ul a,
#nav ul a:hover { float:none; padding:0; line-height:1.3em; }
#nav ul li.over a,
#nav ul li.over a:hover,
#nav ul li:hover a,
#nav ul li:hover a:hover,
#nav ul a,
#nav li.active li { font-weight:normal; }

Expand All @@ -50,17 +50,18 @@
#nav ul ul { border-top:0; background:url(images/nav3_bg.png) 0 0 no-repeat; padding-top:2px; left:100px; top:13px; }

/* Show menu */
#nav li.over ul { left:-1px; }
#nav li.over ul ul { left:-10000px; }
#nav li.over ul li.over ul { left:100px; }
#nav li:hover ul { left:-1px; }
#nav li:hover ul ul { left:-10000px; }
#nav li:hover ul li:hover ul { left:100px; }

#nav ul li { background:url(images/nav2_li_bg.png) repeat-y; padding:0 2px; }
#nav ul li a { background:#e3ecee; }
#nav ul li a:hover { background:#d0dfe2; }
#nav li.over ul a,
#nav li:hover ul a,
#nav ul li.active a,
#nav ul li a,
#nav ul li a:hover { color:#2f2f2f; }
#nav ul li a.active { text-decoration:underline; }
#nav ul span,
#nav ul li.last li span { padding:5px 15px; background:url(images/nav2_link_bg.gif) repeat-x 0 100%; }
#nav ul li.last span,
Expand All @@ -84,7 +85,7 @@

/* Show menu */
#nav ul ul ul { left:-10000px; }
#nav li.over ul li.over ul ul { left:-10000px;}
#nav li.over ul li.over ul li.over ul { left:100px; }
#nav li:hover ul li:hover ul ul { left:-10000px;}
#nav li:hover ul li:hover ul li:hover ul { left:100px; }

.nav-bar:after { content:"."; display:block; clear:both; font-size:0; line-height:0; height:0; overflow:hidden; }
39 changes: 21 additions & 18 deletions skin/adminhtml/default/openmage/menu.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 1 addition & 7 deletions skin/adminhtml/default/openmage/menu.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 10 additions & 7 deletions skin/adminhtml/default/openmage/scss/menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
text-align: left;
float: left;

&.over {
&:hover {
z-index: 999;

a {
Expand All @@ -46,14 +46,14 @@
font-size: 12px;
}

li.over ul {
li:hover ul {
left: 100px;

ul {
left: -10000px;
}

li.over ul {
li:hover ul {
left: 100px;
}
}
Expand Down Expand Up @@ -106,7 +106,7 @@
border-color: transparent transparent transparent $color_silver_approx;
}

&.over > a {
&:hover > a {
background: darken($openmage_base_blue,12);
color: $white;
}
Expand Down Expand Up @@ -200,6 +200,9 @@
color: $color_dorado_approx;
font-size: 12px;

&.active {
text-decoration: underline;
}
&:hover {
background: $color_dorado_approx;
color: $white;
Expand Down Expand Up @@ -230,7 +233,7 @@
}
}

&.over a {
&:hover a {
font-weight: normal;

&:hover {
Expand Down Expand Up @@ -314,7 +317,7 @@
padding: 0 10px;
}
}
&.over ul {
&:hover ul {
right: 27px;
display: block;
a {
Expand All @@ -333,4 +336,4 @@
width: auto;
}
}
}
}

0 comments on commit 19048e0

Please sign in to comment.