navigation-dock MDL-22560 Major changes to he way the dock works

* Themes can now check if a region is completely docked
* Dock now delegates events to improve performance
* Dock now completely YUI3
* No longer uses YUI overlay instead has custom control
This commit is contained in:
Sam Hemelryk 2010-05-31 03:33:34 +00:00
parent 8cb4148657
commit 7e4617f7a6
12 changed files with 766 additions and 711 deletions

View file

@ -92,8 +92,6 @@ class block_navigation extends block_base {
function get_required_javascript() {
global $CFG;
$this->page->requires->js_module(array('name'=>'core_dock', 'fullpath'=>'/blocks/dock.js', 'requires'=>array('base', 'cookie', 'dom', 'io', 'node', 'event-custom', 'event-mouseenter', 'yui2-container')));
$this->page->requires->js_module(array('name'=>'block_navigation', 'fullpath'=>'/blocks/navigation/navigation.js', 'requires'=>array('core_dock', 'io', 'node', 'dom', 'event-custom', 'json-parse')));
user_preference_allow_ajax_update('docked_block_instance_'.$this->instance->id, PARAM_INT);
}
@ -162,14 +160,13 @@ class block_navigation extends block_base {
$navigation->find_expandable($expandable);
// Initialise the JS tree object
$module = array('name'=>'block_navigation', 'fullpath'=>'/blocks/navigation/navigation.js', 'requires'=>array('core_dock', 'io', 'node', 'dom', 'event-custom', 'json-parse'));
$module = array('name'=>'block_navigation', 'fullpath'=>'/blocks/navigation/navigation.js', 'requires'=>array('core_dock', 'io', 'node', 'dom', 'event-custom', 'json-parse'), 'strings'=>array(array('viewallcourses','moodle')));
$limit = 20;
if (!empty($CFG->navcourselimit)) {
$limit = $CFG->navcourselimit;
}
$arguments = array($this->instance->id, array('expansions'=>$expandable, 'instance'=>$this->instance->id, 'candock'=>$this->instance_can_be_docked(), 'courselimit'=>$limit));
$this->page->requires->js_init_call('M.block_navigation.init_add_tree', $arguments, false, $module);
$this->page->requires->string_for_js('viewallcourses','moodle');
// Grab the items to display
$renderer = $this->page->get_renderer('block_navigation');

View file

@ -47,6 +47,7 @@ M.block_navigation = M.block_navigation || {
* @function
*/
init:function(Y) {
M.core_dock.init(Y);
if (M.core_dock.genericblock) {
// Give the tree class the dock block properties
Y.augment(M.block_navigation.classes.tree, M.core_dock.genericblock);