Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-33573 Remove anchor from activity chooser link until JS is ready

  • Loading branch information...
commit 928cc791e6d50d4677ef042c648a285a8420045f 1 parent de6a0df
@andrewnicols andrewnicols authored
Showing with 8 additions and 3 deletions.
  1. +1 −1  course/lib.php
  2. +7 −2 course/yui/modchooser/modchooser.js
View
2  course/lib.php
@@ -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');
View
9 course/yui/modchooser/modchooser.js
@@ -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);
},
/**
Please sign in to comment.
Something went wrong with that request. Please try again.