61 lines
2.3 KiB
JavaScript
61 lines
2.3 KiB
JavaScript
//>>built
|
|
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\">✓</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"}});
|
|
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);
|
|
}
|
|
});
|
|
});
|