]>
git.wh0rd.org - tt-rss.git/blob - lib/dijit/_DialogMixin.js.uncompressed.js
1 define("dijit/_DialogMixin", [
2 "dojo/_base/declare", // declare
3 "./a11y" // _getTabNavigable
4 ], function(declare
, a11y
){
9 return declare("dijit._DialogMixin", null, {
11 // This provides functions useful to Dialog and TooltipDialog
13 execute: function(/*Object*/ /*===== formContents =====*/){
15 // Callback when the user hits the submit button.
16 // Override this method to handle Dialog execution.
18 // After the user has pressed the submit button, the Dialog
19 // first calls onExecute() to notify the container to hide the
20 // dialog and restore focus to wherever it used to be.
22 // *Then* this method is called.
29 // Called when user has pressed the Dialog's cancel button, to notify container.
31 // Developer shouldn't override or connect to this method;
32 // it's a private communication device between the TooltipDialog
33 // and the thing that opened it (ex: `dijit/form/DropDownButton`)
38 onExecute: function(){
40 // Called when user has pressed the dialog's OK button, to notify container.
42 // Developer shouldn't override or connect to this method;
43 // it's a private communication device between the TooltipDialog
44 // and the thing that opened it (ex: `dijit/form/DropDownButton`)
49 _onSubmit: function(){
51 // Callback when user hits submit button
54 this.onExecute(); // notify container that we are about to execute
55 this.execute(this.get('value'));
58 _getFocusItems: function(){
60 // Finds focusable items in dialog,
61 // and sets this._firstFocusItem and this._lastFocusItem
65 var elems
= a11y
._getTabNavigable(this.containerNode
);
66 this._firstFocusItem
= elems
.lowest
|| elems
.first
|| this.closeButtonNode
|| this.domNode
;
67 this._lastFocusItem
= elems
.last
|| elems
.highest
|| this._firstFocusItem
;