Fixed problems with the sizing of the sidemenu, as well as the animation problem (an issue caused by the lack of clear parent container sizing, since the parent was just a table cell). This is actually much cleaner, allowing us to ignore #sidecolumn in the sidemenu.css file, and simplifies jQuery accordion work as well (thus no jitter). Added a mechanism to dump javascript in a consistent place, when generated from elements included by the layout (namely, our sidemenu element). Finally, added a new event called hoverintent, since the mouseover feature works very poorly with the accordion module when animation is in use.
git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@774 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -11,6 +11,12 @@
|
||||
// REVISIT <AP>: 20090823
|
||||
// Add way to slide the entire menu off the page
|
||||
|
||||
// The sidemenu-container is necessary to define the
|
||||
// bounds as the parent of the sidemenu div, which will
|
||||
// be heavily manipulated by the accordion module. If
|
||||
// we don't have good control over the parent, the
|
||||
// accordion will get confused and behave poorly.
|
||||
echo('<DIV ID="sidemenu-container">' . "\n");
|
||||
echo('<DIV ID="sidemenu">' . "\n");
|
||||
|
||||
$section = 0;
|
||||
@@ -53,22 +59,25 @@ foreach ($menu['areas'] AS $area_name => $area) {
|
||||
}
|
||||
}
|
||||
|
||||
echo('</DIV>' . "\n");
|
||||
//pr(compact('section', 'active_section'));
|
||||
echo('</DIV>' . "\n"); // End #sidemenu
|
||||
echo('</DIV>' . "\n"); // End #sidemenu-container
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript"><!--
|
||||
// Uses both hoverintent, which is a more user friendly mechanism
|
||||
// than mouseover, as well as click. This provides 1) a workable
|
||||
// solution for those browsers that don't use pointers, such as
|
||||
// a touchscreen, and 2) a means to open the menu if the animation
|
||||
// was running while the user moved the pointer to a new menu area.
|
||||
$javascript->codeBlock(
|
||||
<<<JSCB
|
||||
jQuery(document).ready(function(){
|
||||
jQuery('#sidemenu').accordion
|
||||
({ fillSpace : true,
|
||||
event : 'mouseover',
|
||||
<?php if (isset($active_section)) echo "active : $active_section,\n"; ?>
|
||||
<?php /* REVISIT <AP>: 20090823
|
||||
* Prevent animation until we can figure out why we
|
||||
* get animation width jitter */ ?>
|
||||
animated : false,
|
||||
});
|
||||
});
|
||||
|
||||
--></script>
|
||||
jQuery("#sidemenu").accordion
|
||||
({ fillSpace : true,
|
||||
event : "click hoverintent",
|
||||
animated : "bounceslide",
|
||||
JSCB
|
||||
. (isset($active_section) ? "\tactive : $active_section,\n" : '') .
|
||||
<<<JSCB
|
||||
});
|
||||
});
|
||||
JSCB
|
||||
, array('inline' => false));
|
||||
|
||||
Reference in New Issue
Block a user