From c397e0c8bc387a0db701f2aeb58479894c2aff24 Mon Sep 17 00:00:00 2001 From: Andrew Robert Nicols Date: Thu, 21 Jun 2012 09:19:11 +0100 Subject: [PATCH] MDL-33936 Detect activity chooser in block_site_main_menu correctly --- course/yui/modchooser/modchooser.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/course/yui/modchooser/modchooser.js b/course/yui/modchooser/modchooser.js index 9229714acc477..aea4040b47a13 100644 --- a/course/yui/modchooser/modchooser.js +++ b/course/yui/modchooser/modchooser.js @@ -88,6 +88,11 @@ YUI.add('moodle-course-modchooser', function(Y) { Y.one(baseselector).all(CSS.SECTION).each(function(section) { this._setup_for_section(section); }, this); + + // Setup for the block site menu + Y.one(baseselector).all(CSS.SITEMENU).each(function(section) { + this._setup_for_section(section); + }, this); }, _setup_for_section : function(section, sectionid) { var chooserspan = section.one(CSS.SECTIONMODCHOOSER); @@ -116,6 +121,9 @@ YUI.add('moodle-course-modchooser', function(Y) { } else if (e.target.ancestor(CSS.SECTION)) { var section = e.target.ancestor(CSS.SECTION); this.sectionid = section.get('id').replace('section-', ''); + } else if (e.target.ancestor(CSS.SITEMENU)) { + // The block site menu has a sectionid of 0 + this.sectionid = 0; } this.display_chooser(e); },