Merge branch 'MDL-28235-master' of git://github.com/FMCorz/moodle

This commit is contained in:
Sam Hemelryk
2012-10-30 17:37:06 +13:00
4 changed files with 10 additions and 7 deletions

View File

@@ -1453,16 +1453,17 @@ M.util.help_icon = {
event.preventDefault();
if (M.util.help_icon.instance === null) {
var Y = M.util.help_icon.Y;
Y.use('overlay', 'io-base', 'event-mouseenter', 'node', 'event-key', function(Y) {
Y.use('overlay', 'io-base', 'event-mouseenter', 'node', 'event-key', 'escape', function(Y) {
var help_content_overlay = {
helplink : null,
overlay : null,
init : function() {
var closebtn = Y.Node.create('<a id="closehelpbox" href="#"><img src="'+M.util.image_url('t/delete', 'moodle')+'" /></a>');
var strclose = Y.Escape.html(M.str.form.close);
var footerbtn = Y.Node.create('<button class="closebtn">'+strclose+'</button>');
// Create an overlay from markup
this.overlay = new Y.Overlay({
headerContent: closebtn,
footerContent: footerbtn,
bodyContent: '',
id: 'helppopupbox',
width:'400px',
@@ -1471,7 +1472,7 @@ M.util.help_icon = {
});
this.overlay.render(Y.one(document.body));
closebtn.on('click', this.overlay.hide, this.overlay);
footerbtn.on('click', this.overlay.hide, this.overlay);
var boundingBox = this.overlay.get("boundingBox");
@@ -1487,9 +1488,6 @@ M.util.help_icon = {
this.overlay.hide();
}
}, this);
Y.on("key", this.close, closebtn , "down:13", this);
closebtn.on('click', this.close, this);
},
close : function(e) {