summaryrefslogtreecommitdiff
path: root/lib/dijit/CheckedMenuItem.js.uncompressed.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dijit/CheckedMenuItem.js.uncompressed.js')
-rw-r--r--lib/dijit/CheckedMenuItem.js.uncompressed.js59
1 files changed, 59 insertions, 0 deletions
diff --git a/lib/dijit/CheckedMenuItem.js.uncompressed.js b/lib/dijit/CheckedMenuItem.js.uncompressed.js
new file mode 100644
index 000000000..caa3bc7bf
--- /dev/null
+++ b/lib/dijit/CheckedMenuItem.js.uncompressed.js
@@ -0,0 +1,59 @@
+require({cache:{
+'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\">&#10003;</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\">&#160;</td>\n</tr>\n"}});
+define("dijit/CheckedMenuItem", [
+ "dojo/_base/declare", // declare
+ "dojo/dom-class", // domClass.toggle
+ "./MenuItem",
+ "dojo/text!./templates/CheckedMenuItem.html",
+ "./hccss"
+], function(declare, domClass, MenuItem, template){
+
+/*=====
+ var MenuItem = dijit.MenuItem;
+=====*/
+
+ // module:
+ // dijit/CheckedMenuItem
+ // summary:
+ // A checkbox-like menu item for toggling on and off
+
+ return declare("dijit.CheckedMenuItem", MenuItem, {
+ // summary:
+ // A checkbox-like menu item for toggling on and off
+
+ templateString: template,
+
+ // checked: Boolean
+ // Our checked state
+ checked: false,
+ _setCheckedAttr: function(/*Boolean*/ checked){
+ // summary:
+ // Hook so attr('checked', bool) works.
+ // Sets the class and state for the check box.
+ domClass.toggle(this.domNode, "dijitCheckedMenuItemChecked", checked);
+ this.domNode.setAttribute("aria-checked", checked);
+ this._set("checked", checked);
+ },
+
+ iconClass: "", // override dijitNoIcon
+
+ onChange: function(/*Boolean*/ /*===== checked =====*/){
+ // summary:
+ // User defined function to handle check/uncheck events
+ // tags:
+ // callback
+ },
+
+ _onClick: function(/*Event*/ e){
+ // summary:
+ // Clicking this item just toggles its state
+ // tags:
+ // private
+ if(!this.disabled){
+ this.set("checked", !this.checked);
+ this.onChange(this.checked);
+ }
+ this.inherited(arguments);
+ }
+ });
+});