X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=blobdiff_plain;f=lib%2Fyui%2Fsrc%2Fnotification%2Fjs%2Fdialogue.js;h=e6ea2b974b65223303a638732bf98b88efda7d02;hp=bc2a5e75dcf150a70eeed2ed23bc2e2be5c9c1ac;hb=6b25e62f4886c840e93fff64845f48f87a680e09;hpb=c932a4db7c9b87dabda628376a1c0ac82873e8fc diff --git a/lib/yui/src/notification/js/dialogue.js b/lib/yui/src/notification/js/dialogue.js index bc2a5e75dcf..e6ea2b974b6 100644 --- a/lib/yui/src/notification/js/dialogue.js +++ b/lib/yui/src/notification/js/dialogue.js @@ -303,6 +303,26 @@ Y.extend(DIALOGUE, Y.Panel, { shouldResizeFullscreen : function() { return (window === window.parent) && this.get('responsive') && Math.floor(Y.one(document.body).get('winWidth')) < this.get('responsiveWidth'); + }, + + /** + * Override the show method to set keyboard focus on the dialogue. + * + * @method show + * @return void + */ + show : function() { + var result = null, + header = this.headerNode, + content = this.bodyNode; + + result = DIALOGUE.superclass.show.call(this); + if (header && header !== '') { + header.focus(); + } else if (content && content !== '') { + content.focus(); + } + return result; } }, { NAME : DIALOGUE_NAME,