MDL-30899 moodle-core-notification Adding focus to non modal windows
[moodle.git] / blocks / community / yui / imagegallery / imagegallery.js
index 2f0c65c..a4cb457 100644 (file)
@@ -93,7 +93,6 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
             var panel = Y.one('#imageoverlay');
             panel.setContent('');
 
-
             panel.append(Y.Node.create('<div style="text-align:center"><img id=\"imagetodisplay\" src="' + url
                 + '" style="max-height:' + maxheight + 'px;"></div>'));
             this.panel.destroy();
@@ -132,6 +131,9 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
                 this.panel.set("centered", true);
                 this.panel.show();
 
+                // Focus on the close button
+                this.panel.get('buttons').header[0].focus();
+
             }, this, url);
 
             var previousnumber = screennumber - 1;