forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
group MDL-21533 Replaced overlib usage within Group with YUI3 equivil…
…ant JavaScript code
- Loading branch information
Sam Hemelryk
committed
Feb 24, 2010
1 parent
4f5b5ca
commit c248959
Showing
4 changed files
with
70 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* To change this template, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
M.core_group = { | ||
hoveroverlay : null | ||
}; | ||
|
||
M.core_group.init_hover_events = function(Y, events) { | ||
// Prepare the overlay if it hasn't already been created | ||
this.hoveroverlay = this.hoveroverlay || (function(){ | ||
// New Y.Overlay | ||
var overlay = new Y.Overlay({ | ||
bodyContent : 'Loading', | ||
visible : false, | ||
zIndex : 2 | ||
}); | ||
// Render it against the page | ||
overlay.render(Y.one('#page')); | ||
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); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters