Active
Project:
Javascript Tools
Version:
master
Component:
Proposed new addition
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Oct 2007 at 21:44 UTC
Updated:
22 Apr 2009 at 11:30 UTC
It would be great to hide the complete region instead of opening/closing each block. For some site configurations the left or right regions are only helpers for the site navigation, and sometimes disabling them should give more space for the content reading.
I'm not sure about the implications, as the configuration should allow to enable or disable the hide/show option for each region, but the option would give a usability helper for the users.
Thanks in advance!
Comments
Comment #1
surajhs commentedThis code is to expand/collapse submenu in left panel in My Projects section.
Book.module from line 655
function book_tree_recurse($nid, $depth, $children, $unfold = array()) {
global $divheight;
$output = '';
if ($depth > 0) {
if (isset($children[$nid])) {
foreach ($children[$nid] as $foo => $node) {
$divheight = $divheight + 1;
$linktitle = array();
$showhide = array("onClick" => "showHideCat(expand'.$node->nid.')");
if (in_array($node->nid, $unfold)) {
if ($tree = book_tree_recurse($node->nid, $depth - 1, $children, $unfold)) {
$linktitle['title'] = '?q=node/'. $node->nid;
$output .= '
$output .= l($node->title, 'node/'. $node->nid, $linktitle);
$output .= 'nid . '\');" >
'. $tree .'
';
$output .= '
';
}
else {
$linktitle['title'] = '?q=node/'. $node->nid;
$output .= '
';
}
}
else {
if ($tree = book_tree_recurse($node->nid, 1, $children)) {
$linktitle['title'] = '?q=node/'. $node->nid;
$output .= '
$output .= l(trim($node->title), 'node/'. $node->nid, $linktitle);
//$output .= '
'. $tree .'
';
$output .= '
';
}
else {
$linktitle['title'] = '?q=node/'. $node->nid;
$output .= '
';
}
}
}
}
}
return $output;
}
----------------------------------------------------------------------
Add expand.js in modules/jquery_update/expand.js
function showHideCat(el)
{
if (el != null)
{
el.style.display=(el.style.display=='none')?'':'none'
}
}
Hope this helps