BUGFIX: fixed submenu not opening in cms-menu when cms loads on page other than edit page section

This commit is contained in:
Will Rossiter 2011-08-16 15:36:39 +12:00 committed by Ingo Schommer
parent 65b3c3a894
commit 60cba7dd76
5 changed files with 9 additions and 11 deletions

View File

@ -452,7 +452,7 @@ class LeftAndMain extends Controller {
continue;
}
$linkingmode = "";
$linkingmode = "link";
if($menuItem->controller && get_class($this) == $menuItem->controller) {
$linkingmode = "current";

View File

@ -162,6 +162,7 @@ li.class-ErrorPage a .jstree-pageicon { background-position: 0 -112px; }
.cms-menu-list li a:focus, .cms-menu-list li a:active { border-top: 1px solid #a1b2bc; text-decoration: none; background-color: #a1b2bc; color: #393939; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #92a5b2), color-stop(100%, #a1b2bc)); background-image: -webkit-linear-gradient(#92a5b2, #a1b2bc); background-image: -moz-linear-gradient(#92a5b2, #a1b2bc); background-image: -o-linear-gradient(#92a5b2, #a1b2bc); background-image: -ms-linear-gradient(#92a5b2, #a1b2bc); background-image: linear-gradient(#92a5b2, #a1b2bc); }
.cms-menu-list li a .icon { display: block; float: left; margin: 4px 10px 0 4px; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70); opacity: 0.7; }
.cms-menu-list li a .text { display: block; }
.cms-menu-list li ul { display: none; }
.cms-menu-list li.current a { color: white; text-shadow: #1e5270 0 -1px 0; border-top: 1px solid #55a4d2; border-bottom: 1px solid #1e5270; background-color: #338dc1; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #338dc1), color-stop(100%, #287099)); background-image: -webkit-linear-gradient(#338dc1, #287099); background-image: -moz-linear-gradient(#338dc1, #287099); background-image: -o-linear-gradient(#338dc1, #287099); background-image: -ms-linear-gradient(#338dc1, #287099); background-image: linear-gradient(#338dc1, #287099); }
.cms-menu-list li.current ul { border-top: 1px solid #1e5270; }
.cms-menu-list li.current li { background-color: #287099; }

View File

@ -27,11 +27,6 @@
onmatch: function() {
var self = this;
// TODO Fix icon etc.
// this.children('li').each(function() {
// $(this).find('a:first').append('<span class="toggle">o</span>');
// });
$('.cms-container').bind('afterstatechange', function(e, data) {
var controller = data.xhr.getResponseHeader('X-Controller');
if(controller) {

View File

@ -117,7 +117,11 @@
display: block;
}
}
ul {
display: none;
}
&.current {
a {
color: $color-text-light;
@ -174,7 +178,7 @@
}
}
}
&.collapsed {
li .text {
display: none;

View File

@ -24,14 +24,13 @@
<ul class="cms-menu-list">
<% control MainMenu %>
<li class="$LinkingMode $FirstLast <% if LinkingMode == 'current' %>opened<% end_if %>" id="Menu-$Code">
<li class="$LinkingMode $FirstLast <% if LinkingMode == 'link' %><% else %>opened<% end_if %>" id="Menu-$Code">
<a href="$Link">
<span class="icon icon-16 icon-{$Code.LowerCase}">&nbsp;</span>
<span class="text">$Title</span>
</a>
<% if Code == 'CMSMain' %>
<% if LinkingMode == 'current' %>
<ul>
<li class="first <% if Top.class == 'CMSPageEditController' || Top.class == 'CMSMain' %>current<% end_if %>" id="Menu-CMSPageEditController"><a href="admin/page/edit/show/$Top.CurrentPageID">
<span class="text">Content</span>
@ -46,7 +45,6 @@
<span class="text">History</span>
</a></li>
</ul>
<% end_if %>
<% end_if %>
</li>
<% end_control %>