Skip to content

Commit

Permalink
Menu: remove deprecated APIs, refs #4:
Browse files Browse the repository at this point in the history
- remove deprecated setLabel(), setDisabled()
- remove dijit-legacy-mode
- quirksmode support
- _Widget --> _WidgetBase
  • Loading branch information
wkeese committed May 1, 2013
1 parent 6670f16 commit 358f147
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 40 deletions.
19 changes: 5 additions & 14 deletions Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,16 @@ define([
"dojo/keys", // keys.F10
"dojo/_base/lang", // lang.hitch
"dojo/on",
"dojo/sniff", // has("ie"), has("quirks")
"dojo/_base/window", // win.body
"dojo/window", // winUtils.get
"./popup",
"./DropDownMenu",
"dojo/ready"
], function(require, array, declare, dom, domAttr, domGeometry, domStyle, keys, lang, on, has, win, winUtils, pm, DropDownMenu, ready){
"./DropDownMenu"
], function(require, array, declare, dom, domAttr, domGeometry, domStyle, keys, lang, on,
win, winUtils, pm, DropDownMenu){

// module:
// dijit/Menu

// Back compat w/1.6, remove for 2.0
if(has("dijit-legacy-requires")){
ready(0, function(){
var requires = ["dijit/MenuItem", "dijit/PopupMenuItem", "dijit/CheckedMenuItem", "dijit/MenuSeparator"];
require(requires); // use indirection so modules not rolled into a build
});
}

return declare("dijit.Menu", DropDownMenu, {
// summary:
// A context menu you can assign to multiple elements
Expand Down Expand Up @@ -298,8 +289,8 @@ define([

var cs = domStyle.getComputedStyle(iframe),
tp = domStyle.toPixelValue,
left = (has("ie") && has("quirks") ? 0 : tp(iframe, cs.paddingLeft)) + (has("ie") && has("quirks") ? tp(iframe, cs.borderLeftWidth) : 0),
top = (has("ie") && has("quirks") ? 0 : tp(iframe, cs.paddingTop)) + (has("ie") && has("quirks") ? tp(iframe, cs.borderTopWidth) : 0);
left = tp(iframe, cs.paddingLeft),
top = tp(iframe, cs.paddingTop);

coords.x += ifc.x + left - scroll.x;
coords.y += ifc.y + top - scroll.y;
Expand Down
28 changes: 5 additions & 23 deletions MenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ define([
"dojo/dom", // dom.setSelectable
"dojo/dom-attr", // domAttr.set
"dojo/dom-class", // domClass.toggle
"dojo/_base/kernel", // kernel.deprecated
"dojo/sniff", // has("ie")
"dojo/_base/lang", // lang.hitch
"./_Widget",
"./_WidgetBase",
"./_TemplatedMixin",
"./_Contained",
"./_CssStateMixin",
"dojo/text!./templates/MenuItem.html"
], function(declare, dom, domAttr, domClass, kernel, has, lang,
_Widget, _TemplatedMixin, _Contained, _CssStateMixin, template){
], function(declare, dom, domAttr, domClass, has, lang,
_WidgetBase, _TemplatedMixin, _Contained, _CssStateMixin, template){

// module:
// dijit/MenuItem

var MenuItem = declare("dijit.MenuItem" + (has("dojo-bidi") ? "_NoBidi" : ""),
[_Widget, _TemplatedMixin, _Contained, _CssStateMixin], {
[_WidgetBase, _TemplatedMixin, _Contained, _CssStateMixin], {

// summary:
// A line item in a Menu Widget

Expand Down Expand Up @@ -137,24 +137,6 @@ define([
domClass.toggle(this.domNode, "dijitMenuItemSelected", selected);
},

setLabel: function(/*String*/ content){
// summary:
// Deprecated. Use set('label', ...) instead.
// tags:
// deprecated
kernel.deprecated("dijit.MenuItem.setLabel() is deprecated. Use set('label', ...) instead.", "", "2.0");
this.set("label", content);
},

setDisabled: function(/*Boolean*/ disabled){
// summary:
// Deprecated. Use set('disabled', bool) instead.
// tags:
// deprecated
kernel.deprecated("dijit.Menu.setDisabled() is deprecated. Use set('disabled', bool) instead.", "", "2.0");
this.set('disabled', disabled);
},

_setDisabledAttr: function(/*Boolean*/ value){
// summary:
// Hook for attr('disabled', ...) to work.
Expand Down
6 changes: 3 additions & 3 deletions _MenuBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ define([
"dojo/window",
"./a11yclick",
"./registry",
"./_Widget",
"./_WidgetBase",
"./_CssStateMixin",
"./_KeyNavContainer",
"./_TemplatedMixin"
], function(array, declare, dom, domAttr, domClass, lang, mouse, on, winUtils, a11yclick,
registry, _Widget, _CssStateMixin, _KeyNavContainer, _TemplatedMixin){
registry, _WidgetBase, _CssStateMixin, _KeyNavContainer, _TemplatedMixin){

// module:
// dijit/_MenuBase

return declare("dijit._MenuBase", [_Widget, _TemplatedMixin, _KeyNavContainer, _CssStateMixin], {
return declare("dijit._MenuBase", [_WidgetBase, _TemplatedMixin, _KeyNavContainer, _CssStateMixin], {
// summary:
// Abstract base class for Menu and MenuBar.
// Subclass should implement _onUpArrow(), _onDownArrow(), _onLeftArrow(), and _onRightArrow().
Expand Down

0 comments on commit 358f147

Please sign in to comment.