MDL-33573 Remove anchor from activity chooser link until JS is ready
authorAndrew Robert Nicols <andrew.nicols@luns.net.uk>
Thu, 7 Jun 2012 09:15:52 +0000 (10:15 +0100)
committerAndrew Robert Nicols <andrew.nicols@luns.net.uk>
Thu, 7 Jun 2012 09:15:52 +0000 (10:15 +0100)
course/lib.php
course/yui/modchooser/modchooser.js

index 26fea72..e60c04f 100644 (file)
@@ -1851,7 +1851,7 @@ function print_section_add_menus($course, $section, $modnames, $vertical=false,
         $modchooser.= html_writer::start_tag('div', array('class' => 'section-modchooser'));
         $icon = $OUTPUT->pix_icon('t/add', $straddeither);
         $span = html_writer::tag('span', $straddeither, array('class' => 'section-modchooser-text'));
-        $modchooser.= html_writer::link('#', $icon.$span, array('class' => 'section-modchooser-link'));
+        $modchooser .= html_writer::tag('span', $icon . $span, array('class' => 'section-modchooser-link'));
         $modchooser.= html_writer::end_tag('div');
         $modchooser.= html_writer::end_tag('div');
 
index 5d95a02..9dc2598 100644 (file)
@@ -2,7 +2,7 @@ YUI.add('moodle-course-modchooser', function(Y) {
     var CSS = {
         PAGECONTENT : 'div#page-content',
         SECTION : 'li.section',
-        SECTIONMODCHOOSER : 'a.section-modchooser-link',
+        SECTIONMODCHOOSER : 'span.section-modchooser-link',
         SITEMENU : 'div.block_site_main_menu',
         SITETOPIC : 'div.sitetopic'
     };
@@ -100,7 +100,12 @@ YUI.add('moodle-course-modchooser', function(Y) {
             }, this);
         },
         _setup_for_section : function(section, sectionid) {
-            var chooserlink = section.one(CSS.SECTIONMODCHOOSER);
+            var chooserspan = section.one(CSS.SECTIONMODCHOOSER);
+            var chooserlink = Y.Node.create("<a href='#' />");
+            chooserspan.get('children').each(function(node) {
+                chooserlink.appendChild(node);
+            });
+            chooserspan.insertBefore(chooserlink);
             chooserlink.on('click', this.display_mod_chooser, this, sectionid);
         },
         /**