From: <dcr...@hy...> - 2010-04-13 21:30:46
|
Author: dcrutchf Date: 2010-04-13 14:30:38 -0700 (Tue, 13 Apr 2010) New Revision: 14502 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14502 Modified: trunk/web/js/dojo/1.1.2/dijit/Dialog.js Log: Backported an option to autofocus (or not) when the dialog is shown. http://bugs.dojotoolkit.org/attachment/ticket/7287/Dialog.patch This has been included in the latest dojo build, so we'll continue to get the functionality when we upgrade. Modified: trunk/web/js/dojo/1.1.2/dijit/Dialog.js =================================================================== --- trunk/web/js/dojo/1.1.2/dijit/Dialog.js 2010-04-13 21:28:28 UTC (rev 14501) +++ trunk/web/js/dojo/1.1.2/dijit/Dialog.js 2010-04-13 21:30:38 UTC (rev 14502) @@ -157,6 +157,8 @@ // False will disable refocusing. Default: true refocus: true, + autofocus: true, + // _firstFocusItem: DomNode // The pointer to the first focusable node in the dialog _firstFocusItem:null, @@ -351,9 +353,11 @@ this._getFocusItems(this.domNode); // set timeout to allow the browser to render dialog - setTimeout(dojo.hitch(this, function(){ - dijit.focus(this._firstFocusItem); - }), 50); + if(this.autofocus){ + setTimeout(dojo.hitch(this, function(){ + dijit.focus(this._firstFocusItem); + }), 50); + } }, hide: function(){ |