navigation MDL-23831 Always show activity icons on the navigation

This commit is contained in:
Sam Hemelryk
2010-08-17 02:43:09 +00:00
parent aa721d7635
commit ea2bc3599b
4 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -331,7 +331,7 @@ M.block_navigation.classes.branch.prototype.inject_into_dom = function(element)
// Prepare the icon, should be an object representing a pix_icon
var branchicon = false;
if (this.icon != null && !isbranch) {
if (this.icon != null && (!isbranch || this.type == 40)) {
branchicon = Y.Node.create('<img alt="" />');
branchicon.setAttribute('src', M.util.image_url(this.icon.pix, this.icon.component));
branchli.addClass('item_with_icon');
+1 -1
View File
@@ -27,7 +27,7 @@ class block_navigation_renderer extends plugin_renderer_base {
$content = $item->get_content();
$title = $item->get_title();
$isbranch = ($item->type !== $expansionlimit && ($item->children->count() > 0 || ($item->nodetype == navigation_node::NODETYPE_BRANCH && $item->children->count()==0 && (isloggedin() || $item->type <= navigation_node::TYPE_CATEGORY))));
$hasicon = (!$isbranch && $item->icon instanceof renderable);
$hasicon = ((!$isbranch || $item->type == navigation_node::TYPE_ACTIVITY)&& $item->icon instanceof renderable);
if ($hasicon) {
$icon = $this->output->render($item->icon);
+2
View File
@@ -10,6 +10,8 @@
.block_navigation .block_tree .tree_item.branch {background-image: url([[pix:t/expanded]]);background-position: 0 10%;background-repeat: no-repeat;}
.block_navigation .block_tree .navigation_node.tree_item.branch {background-image:none;padding-left:0;}
.block_navigation .block_tree .type_activity > .tree_item.branch {background-image:none;position:relative;}
.block_navigation .block_tree .type_activity > .tree_item.branch img {position:absolute;left:0;}
.block_navigation .block_tree .root_node.leaf {padding-left:0px;}
.block_navigation .block_tree .current_branch {font-weight:bold;}
.block_navigation .block_tree .depth_1.current_branch ul {font-weight:normal;}
+1 -1
View File
@@ -1254,7 +1254,7 @@ function chat_extend_navigation($navigation, $course, $module, $cm) {
$links[] = new action_link($url, get_string('noframesjs', 'message'), $action);
foreach ($links as $link) {
$navigation->add($link->text, $link, navigation_node::TYPE_ACTIVITY, null ,null, new pix_icon('c/group' , ''));
$navigation->add($link->text, $link, navigation_node::TYPE_SETTING, null ,null, new pix_icon('c/group' , ''));
}
}