From 1354d17270961fff662d40f90521223f8fd0d73b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 14 Aug 2012 18:59:10 +0400 Subject: update dojo to 1.7.3 --- lib/dijit/form/_ComboBoxMenu.js.uncompressed.js | 138 ++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 lib/dijit/form/_ComboBoxMenu.js.uncompressed.js (limited to 'lib/dijit/form/_ComboBoxMenu.js.uncompressed.js') diff --git a/lib/dijit/form/_ComboBoxMenu.js.uncompressed.js b/lib/dijit/form/_ComboBoxMenu.js.uncompressed.js new file mode 100644 index 000000000..e46db28ed --- /dev/null +++ b/lib/dijit/form/_ComboBoxMenu.js.uncompressed.js @@ -0,0 +1,138 @@ +define("dijit/form/_ComboBoxMenu", [ + "dojo/_base/declare", // declare + "dojo/dom-class", // domClass.add domClass.remove + "dojo/dom-construct", // domConstruct.create + "dojo/dom-style", // domStyle.get + "dojo/keys", // keys.DOWN_ARROW keys.PAGE_DOWN keys.PAGE_UP keys.UP_ARROW + "../_WidgetBase", + "../_TemplatedMixin", + "./_ComboBoxMenuMixin", + "./_ListMouseMixin" +], function(declare, domClass, domConstruct, domStyle, keys, + _WidgetBase, _TemplatedMixin, _ComboBoxMenuMixin, _ListMouseMixin){ + +/*===== + var _WidgetBase = dijit._WidgetBase; + var _TemplatedMixin = dijit._TemplatedMixin; + var _ComboBoxMenuMixin = dijit.form._ComboBoxMenuMixin; + var _ListMouseMixin = dijit.form._ListMouseMixin; +=====*/ + + // module: + // dijit/form/_ComboBoxMenu + // summary: + // Focus-less menu for internal use in `dijit.form.ComboBox` + + return declare("dijit.form._ComboBoxMenu",[_WidgetBase, _TemplatedMixin, _ListMouseMixin, _ComboBoxMenuMixin], { + // summary: + // Focus-less menu for internal use in `dijit.form.ComboBox` + // Abstract methods that must be defined externally: + // onChange: item was explicitly chosen (mousedown somewhere on the menu and mouseup somewhere on the menu) + // onPage: next(1) or previous(-1) button pressed + // tags: + // private + + templateString: "
" + +"
" + +"
" + +"
", + + baseClass: "dijitComboBoxMenu", + + postCreate: function(){ + this.inherited(arguments); + if(!this.isLeftToRight()){ + domClass.add(this.previousButton, "dijitMenuItemRtl"); + domClass.add(this.nextButton, "dijitMenuItemRtl"); + } + }, + + _createMenuItem: function(){ + return domConstruct.create("div", { + "class": "dijitReset dijitMenuItem" +(this.isLeftToRight() ? "" : " dijitMenuItemRtl"), + role: "option" + }); + }, + + onHover: function(/*DomNode*/ node){ + // summary: + // Add hover CSS + domClass.add(node, "dijitMenuItemHover"); + }, + + onUnhover: function(/*DomNode*/ node){ + // summary: + // Remove hover CSS + domClass.remove(node, "dijitMenuItemHover"); + }, + + onSelect: function(/*DomNode*/ node){ + // summary: + // Add selected CSS + domClass.add(node, "dijitMenuItemSelected"); + }, + + onDeselect: function(/*DomNode*/ node){ + // summary: + // Remove selected CSS + domClass.remove(node, "dijitMenuItemSelected"); + }, + + _page: function(/*Boolean*/ up){ + // summary: + // Handles page-up and page-down keypresses + + var scrollamount = 0; + var oldscroll = this.domNode.scrollTop; + var height = domStyle.get(this.domNode, "height"); + // if no item is highlighted, highlight the first option + if(!this.getHighlightedOption()){ + this.selectNextNode(); + } + while(scrollamount