Skip to content
Permalink
Browse files

Merge branch 'MDL-33683-master-2' of git://git.luns.net.uk/moodle

  • Loading branch information...
Aparup Banerjee
Aparup Banerjee committed Jun 20, 2012
2 parents 5649520 + ae86017 commit c575842ce93cfdd0fc19e6832cb060b322fef224
Showing with 11 additions and 14 deletions.
  1. +11 −14 course/yui/modchooser/modchooser.js
@@ -81,21 +81,12 @@ YUI.add('moodle-course-modchooser', function(Y) {

// Setup for site topics
Y.one(baseselector).all(CSS.SITETOPIC).each(function(section) {
// The site topic has a sectionid of 1
this._setup_for_section(section, 1);
}, this);

// Setup for the site menu
Y.one(baseselector).all(CSS.SITEMENU).each(function(section) {
// The site menu has a sectionid of 0
this._setup_for_section(section, 0);
this._setup_for_section(section);
}, this);

// Setup for standard course topics
Y.one(baseselector).all(CSS.SECTION).each(function(section) {
// Determine the sectionid for this section
var sectionid = section.get('id').replace('section-', '');
this._setup_for_section(section, sectionid);
this._setup_for_section(section);
}, this);
},
_setup_for_section : function(section, sectionid) {
@@ -108,7 +99,7 @@ YUI.add('moodle-course-modchooser', function(Y) {
chooserlink.appendChild(node);
});
chooserspan.insertBefore(chooserlink);
chooserlink.on('click', this.display_mod_chooser, this, sectionid);
chooserlink.on('click', this.display_mod_chooser, this);
},
/**
* Display the module chooser
@@ -117,9 +108,15 @@ YUI.add('moodle-course-modchooser', function(Y) {
* @param secitonid integer The ID of the section triggering the dialogue
* @return void
*/
display_mod_chooser : function (e, sectionid) {
display_mod_chooser : function (e) {
// Set the section for this version of the dialogue
this.sectionid = sectionid;
if (e.target.ancestor(CSS.SITETOPIC)) {
// The site topic has a sectionid of 1
this.sectionid = 1;
} else if (e.target.ancestor(CSS.SECTION)) {
var section = e.target.ancestor(CSS.SECTION);
this.sectionid = section.get('id').replace('section-', '');
}
this.display_chooser(e);
},
toggle_mod_chooser : function(e) {

0 comments on commit c575842

Please sign in to comment.
You can’t perform that action at this time.