Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'MDL-34975-22' of git://github.com/FMCorz/moodle into MO…

…ODLE_22_STABLE
  • Loading branch information...
commit f0cbaa1c19eb4ddb40baf2ac7c8e95729b6bb7f1 2 parents 14e497c + 3b79304
@danpoltawski danpoltawski authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 lib/javascript-static.js
View
16 lib/javascript-static.js
@@ -87,17 +87,17 @@ M.util.CollapsibleRegion = function(Y, id, userpref, strtooltip) {
// Get the caption for the collapsible region
var caption = this.div.one('#'+id + '_caption');
- caption.setAttribute('title', strtooltip);
// Create a link
var a = Y.Node.create('<a href="#"></a>');
- // Create a local scoped lamba function to move nodes to a new link
- var movenode = function(node){
- node.remove();
- a.append(node);
- };
- // Apply the lamba function on each of the captions child nodes
- caption.get('children').each(movenode, this);
+ a.setAttribute('title', strtooltip);
+
+ // Get all the nodes from caption, remove them and append them to <a>
+ while (caption.hasChildNodes()) {
+ child = caption.get('firstChild');
+ child.remove();
+ a.append(child);
+ }
caption.append(a);
// Get the height of the div at this point before we shrink it if required
Please sign in to comment.
Something went wrong with that request. Please try again.