]>
Commit | Line | Data |
---|---|---|
1354d172 AD |
1 | require({cache:{ |
2 | 'url:dijit/templates/CheckedMenuItem.html':"<tr class=\"dijitReset dijitMenuItem\" data-dojo-attach-point=\"focusNode\" role=\"menuitemcheckbox\" tabIndex=\"-1\"\n\t\tdata-dojo-attach-event=\"onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick\">\n\t<td class=\"dijitReset dijitMenuItemIconCell\" role=\"presentation\">\n\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitMenuItemIcon dijitCheckedMenuItemIcon\" data-dojo-attach-point=\"iconNode\"/>\n\t\t<span class=\"dijitCheckedMenuItemIconChar\">✓</span>\n\t</td>\n\t<td class=\"dijitReset dijitMenuItemLabel\" colspan=\"2\" data-dojo-attach-point=\"containerNode,labelNode\"></td>\n\t<td class=\"dijitReset dijitMenuItemAccelKey\" style=\"display: none\" data-dojo-attach-point=\"accelKeyNode\"></td>\n\t<td class=\"dijitReset dijitMenuArrowCell\" role=\"presentation\"> </td>\n</tr>\n"}}); | |
3 | define("dijit/CheckedMenuItem", [ | |
4 | "dojo/_base/declare", // declare | |
5 | "dojo/dom-class", // domClass.toggle | |
6 | "./MenuItem", | |
7 | "dojo/text!./templates/CheckedMenuItem.html", | |
8 | "./hccss" | |
9 | ], function(declare, domClass, MenuItem, template){ | |
10 | ||
11 | /*===== | |
12 | var MenuItem = dijit.MenuItem; | |
13 | =====*/ | |
14 | ||
15 | // module: | |
16 | // dijit/CheckedMenuItem | |
17 | // summary: | |
18 | // A checkbox-like menu item for toggling on and off | |
19 | ||
20 | return declare("dijit.CheckedMenuItem", MenuItem, { | |
21 | // summary: | |
22 | // A checkbox-like menu item for toggling on and off | |
23 | ||
24 | templateString: template, | |
25 | ||
26 | // checked: Boolean | |
27 | // Our checked state | |
28 | checked: false, | |
29 | _setCheckedAttr: function(/*Boolean*/ checked){ | |
30 | // summary: | |
31 | // Hook so attr('checked', bool) works. | |
32 | // Sets the class and state for the check box. | |
33 | domClass.toggle(this.domNode, "dijitCheckedMenuItemChecked", checked); | |
34 | this.domNode.setAttribute("aria-checked", checked); | |
35 | this._set("checked", checked); | |
36 | }, | |
37 | ||
38 | iconClass: "", // override dijitNoIcon | |
39 | ||
40 | onChange: function(/*Boolean*/ /*===== checked =====*/){ | |
41 | // summary: | |
42 | // User defined function to handle check/uncheck events | |
43 | // tags: | |
44 | // callback | |
45 | }, | |
46 | ||
47 | _onClick: function(/*Event*/ e){ | |
48 | // summary: | |
49 | // Clicking this item just toggles its state | |
50 | // tags: | |
51 | // private | |
52 | if(!this.disabled){ | |
53 | this.set("checked", !this.checked); | |
54 | this.onChange(this.checked); | |
55 | } | |
56 | this.inherited(arguments); | |
57 | } | |
58 | }); | |
59 | }); |