]> git.wh0rd.org - tt-rss.git/blob - lib/dijit/_DialogMixin.js.uncompressed.js
update dojo to 1.7.3
[tt-rss.git] / lib / dijit / _DialogMixin.js.uncompressed.js
1 define("dijit/_DialogMixin", [
2 "dojo/_base/declare", // declare
3 "./a11y" // _getTabNavigable
4 ], function(declare, a11y){
5
6 // module:
7 // dijit/_DialogMixin
8 // summary:
9 // _DialogMixin provides functions useful to Dialog and TooltipDialog
10
11 return declare("dijit._DialogMixin", null, {
12 // summary:
13 // This provides functions useful to Dialog and TooltipDialog
14
15 execute: function(/*Object*/ /*===== formContents =====*/){
16 // summary:
17 // Callback when the user hits the submit button.
18 // Override this method to handle Dialog execution.
19 // description:
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.
23 //
24 // *Then* this method is called.
25 // type:
26 // callback
27 },
28
29 onCancel: function(){
30 // summary:
31 // Called when user has pressed the Dialog's cancel button, to notify container.
32 // description:
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`)
36 // type:
37 // protected
38 },
39
40 onExecute: function(){
41 // summary:
42 // Called when user has pressed the dialog's OK button, to notify container.
43 // description:
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`)
47 // type:
48 // protected
49 },
50
51 _onSubmit: function(){
52 // summary:
53 // Callback when user hits submit button
54 // type:
55 // protected
56 this.onExecute(); // notify container that we are about to execute
57 this.execute(this.get('value'));
58 },
59
60 _getFocusItems: function(){
61 // summary:
62 // Finds focusable items in dialog,
63 // and sets this._firstFocusItem and this._lastFocusItem
64 // tags:
65 // protected
66
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;
70 }
71 });
72 });