Skip to content

Commit

Permalink
Merge branch 'MDL-48970' of https://github.com/andrewhancox/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Aug 5, 2015
2 parents f72a201 + fef5179 commit aa29bb3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
33 changes: 15 additions & 18 deletions group/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,21 @@ M.core_group.init_hover_events = function(Y, events) {
return overlay;
})();

// Iterate over the events and attach an event to display the description on
// hover
for (var id in events) {
var node = Y.one('#'+id);
if (node) {
node = node.ancestor();
node.on('mouseenter', function(e, content){
M.core_group.hoveroverlay.set('xy', [this.getX()+(this.get('offsetWidth')/2),this.getY()+this.get('offsetHeight')-5]);
M.core_group.hoveroverlay.set("bodyContent", content);
M.core_group.hoveroverlay.show();
M.core_group.hoveroverlay.get('boundingBox').setStyle('visibility', 'visible');
}, node, events[id]);
node.on('mouseleave', function(e){
M.core_group.hoveroverlay.hide();
M.core_group.hoveroverlay.get('boundingBox').setStyle('visibility', 'hidden');
}, node);
}
}
Y.all('.group_hoverdescription').each(function() {
var node = this.ancestor();
var id = this.getAttribute('data-groupid');

node.on('mouseenter', function(){
M.core_group.hoveroverlay.set('xy', [this.getX()+(this.get('offsetWidth')/2),this.getY()+this.get('offsetHeight')-5]);
M.core_group.hoveroverlay.set("bodyContent", events[id]);
M.core_group.hoveroverlay.show();
M.core_group.hoveroverlay.get('boundingBox').setStyle('visibility', 'visible');
});
node.on('mouseleave', function(){
M.core_group.hoveroverlay.hide();
M.core_group.hoveroverlay.get('boundingBox').setStyle('visibility', 'hidden');
});
});
};

M.core_group.init_index = function(Y, wwwroot, courseid) {
Expand Down
4 changes: 2 additions & 2 deletions group/overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@
if (empty($jsdescription)) {
$line[] = $name;
} else {
$line[] = html_writer::tag('span', $name, array('id'=>'group_'.$gpid));
$hoverevents['group_'.$gpid] = $jsdescription;
$line[] = html_writer::tag('span', $name, array('class' => 'group_hoverdescription', 'data-groupid' => $gpid));
$hoverevents[$gpid] = $jsdescription;
}
$fullnames = array();
foreach ($users as $user) {
Expand Down

0 comments on commit aa29bb3

Please sign in to comment.