]>
Commit | Line | Data |
---|---|---|
2f01fe57 | 1 | /* |
81bea17a | 2 | Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved. |
2f01fe57 AD |
3 | Available via Academic Free License >= 2.1 OR the modified BSD license. |
4 | see: http://dojotoolkit.org/license for details | |
5 | */ | |
6 | ||
7 | ||
81bea17a AD |
8 | if(!dojo._hasResource["dijit._DialogMixin"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. |
9 | dojo._hasResource["dijit._DialogMixin"] = true; | |
2f01fe57 AD |
10 | dojo.provide("dijit._DialogMixin"); |
11 | dojo.require("dijit._Widget"); | |
81bea17a AD |
12 | |
13 | ||
14 | dojo.declare("dijit._DialogMixin", null, | |
15 | { | |
16 | // summary: | |
17 | // This provides functions useful to Dialog and TooltipDialog | |
18 | ||
19 | attributeMap: dijit._Widget.prototype.attributeMap, | |
20 | ||
21 | execute: function(/*Object*/ formContents){ | |
22 | // summary: | |
23 | // Callback when the user hits the submit button. | |
24 | // Override this method to handle Dialog execution. | |
25 | // description: | |
26 | // After the user has pressed the submit button, the Dialog | |
27 | // first calls onExecute() to notify the container to hide the | |
28 | // dialog and restore focus to wherever it used to be. | |
29 | // | |
30 | // *Then* this method is called. | |
31 | // type: | |
32 | // callback | |
33 | }, | |
34 | ||
35 | onCancel: function(){ | |
36 | // summary: | |
37 | // Called when user has pressed the Dialog's cancel button, to notify container. | |
38 | // description: | |
39 | // Developer shouldn't override or connect to this method; | |
40 | // it's a private communication device between the TooltipDialog | |
41 | // and the thing that opened it (ex: `dijit.form.DropDownButton`) | |
42 | // type: | |
43 | // protected | |
44 | }, | |
45 | ||
46 | onExecute: function(){ | |
47 | // summary: | |
48 | // Called when user has pressed the dialog's OK button, to notify container. | |
49 | // description: | |
50 | // Developer shouldn't override or connect to this method; | |
51 | // it's a private communication device between the TooltipDialog | |
52 | // and the thing that opened it (ex: `dijit.form.DropDownButton`) | |
53 | // type: | |
54 | // protected | |
55 | }, | |
56 | ||
57 | _onSubmit: function(){ | |
58 | // summary: | |
59 | // Callback when user hits submit button | |
60 | // type: | |
61 | // protected | |
62 | this.onExecute(); // notify container that we are about to execute | |
63 | this.execute(this.get('value')); | |
64 | }, | |
65 | ||
66 | _getFocusItems: function(){ | |
67 | // summary: | |
68 | // Finds focusable items in dialog, | |
69 | // and sets this._firstFocusItem and this._lastFocusItem | |
70 | // tags: | |
71 | // protected | |
72 | ||
73 | var elems = dijit._getTabNavigable(this.containerNode); | |
74 | this._firstFocusItem = elems.lowest || elems.first || this.closeButtonNode || this.domNode; | |
75 | this._lastFocusItem = elems.last || elems.highest || this._firstFocusItem; | |
76 | } | |
77 | } | |
78 | ); | |
79 | ||
2f01fe57 | 80 | } |