From f0cfe83e3725f9a3928da97a6e3085e79cb25309 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 18 Mar 2013 10:26:24 +0400 Subject: upgrade dojo to 1.8.3 (refs #570) --- lib/dijit/form/ComboButton.js.uncompressed.js | 85 +++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 lib/dijit/form/ComboButton.js.uncompressed.js (limited to 'lib/dijit/form/ComboButton.js.uncompressed.js') diff --git a/lib/dijit/form/ComboButton.js.uncompressed.js b/lib/dijit/form/ComboButton.js.uncompressed.js new file mode 100644 index 000000000..7805c20e7 --- /dev/null +++ b/lib/dijit/form/ComboButton.js.uncompressed.js @@ -0,0 +1,85 @@ +require({cache:{ +'url:dijit/form/templates/ComboButton.html':"
\n"}}); +define("dijit/form/ComboButton", [ + "dojo/_base/declare", // declare + "dojo/_base/event", // event.stop + "dojo/keys", // keys + "../focus", // focus.focus() + "./DropDownButton", + "dojo/text!./templates/ComboButton.html" +], function(declare, event, keys, focus, DropDownButton, template){ + +// module: +// dijit/form/ComboButton + +return declare("dijit.form.ComboButton", DropDownButton, { + // summary: + // A combination button and drop-down button. + // Users can click one side to "press" the button, or click an arrow + // icon to display the drop down. + // + // example: + // | + // + // example: + // | var button1 = new ComboButton({label: "hello world", onClick: foo, dropDown: "myMenu"}); + // | dojo.body().appendChild(button1.domNode); + // + + templateString: template, + + // Map widget attributes to DOMNode attributes. + _setIdAttr: "", // override _FormWidgetMixin which puts id on the focusNode + _setTabIndexAttr: ["focusNode", "titleNode"], + _setTitleAttr: "titleNode", + + // optionsTitle: String + // Text that describes the options menu (accessibility) + optionsTitle: "", + + baseClass: "dijitComboButton", + + // Set classes like dijitButtonContentsHover or dijitArrowButtonActive depending on + // mouse action over specified node + cssStateNodes: { + "buttonNode": "dijitButtonNode", + "titleNode": "dijitButtonContents", + "_popupStateNode": "dijitDownArrowButton" + }, + + _focusedNode: null, + + _onButtonKeyPress: function(/*Event*/ evt){ + // summary: + // Handler for right arrow key when focus is on left part of button + if(evt.charOrCode == keys[this.isLeftToRight() ? "RIGHT_ARROW" : "LEFT_ARROW"]){ + focus.focus(this._popupStateNode); + event.stop(evt); + } + }, + + _onArrowKeyPress: function(/*Event*/ evt){ + // summary: + // Handler for left arrow key when focus is on right part of button + if(evt.charOrCode == keys[this.isLeftToRight() ? "LEFT_ARROW" : "RIGHT_ARROW"]){ + focus.focus(this.titleNode); + event.stop(evt); + } + }, + + focus: function(/*String*/ position){ + // summary: + // Focuses this widget to according to position, if specified, + // otherwise on arrow node + // position: + // "start" or "end" + if(!this.disabled){ + focus.focus(position == "start" ? this.titleNode : this._popupStateNode); + } + } +}); + +}); -- cgit v1.2.3