]>
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 // _DialogMixin provides functions useful to Dialog and TooltipDialog
11 return declare("dijit._DialogMixin", null, {
13 // This provides functions useful to Dialog and TooltipDialog
15 execute: function(/*Object*/ /*===== formContents =====*/){
17 // Callback when the user hits the submit button.
18 // Override this method to handle Dialog execution.
20 // After the user has pressed the submit button, the Dialog
21 // first calls onExecute() to notify the container to hide the
22 // dialog and restore focus to wherever it used to be.
24 // *Then* this method is called.
31 // Called when user has pressed the Dialog's cancel button, to notify container.
33 // Developer shouldn't override or connect to this method;
34 // it's a private communication device between the TooltipDialog
35 // and the thing that opened it (ex: `dijit.form.DropDownButton`)
40 onExecute: function(){
42 // Called when user has pressed the dialog's OK button, to notify container.
44 // Developer shouldn't override or connect to this method;
45 // it's a private communication device between the TooltipDialog
46 // and the thing that opened it (ex: `dijit.form.DropDownButton`)
51 _onSubmit: function(){
53 // Callback when user hits submit button
56 this.onExecute(); // notify container that we are about to execute
57 this.execute(this.get('value'));
60 _getFocusItems: function(){
62 // Finds focusable items in dialog,
63 // and sets this._firstFocusItem and this._lastFocusItem
67 var elems
= a11y
._getTabNavigable(this.containerNode
);
68 this._firstFocusItem
= elems
.lowest
|| elems
.first
|| this.closeButtonNode
|| this.domNode
;
69 this._lastFocusItem
= elems
.last
|| elems
.highest
|| this._firstFocusItem
;