diff options
| author | Tristan Zur <tzur@web.web.ccwn.org> | 2014-03-27 22:27:47 +0100 |
|---|---|---|
| committer | Tristan Zur <tzur@web.web.ccwn.org> | 2014-03-27 22:27:47 +0100 |
| commit | b62676ca5d3d6f6ba3f019ea3f99722e165a98d8 (patch) | |
| tree | 86722cb80f07d4569f90088eeaea2fc2f6e2ef94 /js/dojo-1.7.2/dojox/mobile/_ComboBoxMenu.js | |
Diffstat (limited to 'js/dojo-1.7.2/dojox/mobile/_ComboBoxMenu.js')
| -rw-r--r-- | js/dojo-1.7.2/dojox/mobile/_ComboBoxMenu.js | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/js/dojo-1.7.2/dojox/mobile/_ComboBoxMenu.js b/js/dojo-1.7.2/dojox/mobile/_ComboBoxMenu.js new file mode 100644 index 0000000..635881f --- /dev/null +++ b/js/dojo-1.7.2/dojox/mobile/_ComboBoxMenu.js @@ -0,0 +1,82 @@ +//>>built +define("dojox/mobile/_ComboBoxMenu", [ + "dojo/_base/kernel", + "dojo/_base/declare", + "dojo/dom-class", + "dojo/dom-construct", + "dijit/form/_ComboBoxMenuMixin", + "dijit/_WidgetBase", + "dojox/mobile/_ListTouchMixin", + "./scrollable" +], + function(dojo, declare, domClass, domConstruct, ComboBoxMenuMixin, WidgetBase, ListTouchMixin, Scrollable){ + + /*===== + ComboBoxMenuMixin = dijit.form._ComboBoxMenuMixin; + WidgetBase = dijit._WidgetBase; + ListTouchMixin = dojox.mobile._ListTouchMixin; + =====*/ + return declare("dojox.mobile._ComboBoxMenu", [WidgetBase, ListTouchMixin, 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 + + baseClass: "mblComboBoxMenu", + bgIframe: true, // so it's not created for IE and FF + + buildRendering: function(){ + this.domNode = this.focusNode = domConstruct.create("div", { "class":"mblReset" }); + this.containerNode = domConstruct.create("div", { style: { position:"absolute", top:0, left:0 } }, this.domNode); // needed for scrollable + this.previousButton = domConstruct.create("div", { "class":"mblReset mblComboBoxMenuItem mblComboBoxMenuPreviousButton", role:"option" }, this.containerNode); + this.nextButton = domConstruct.create("div", { "class":"mblReset mblComboBoxMenuItem mblComboBoxMenuNextButton", role:"option" }, this.containerNode); + this.inherited(arguments); + }, + + _createMenuItem: function(){ + return domConstruct.create("div", { + "class": "mblReset mblComboBoxMenuItem" +(this.isLeftToRight() ? "" : " mblComboBoxMenuItemRtl"), + role: "option" + }); + }, + + onSelect: function(/*DomNode*/ node){ + // summary: + // Add selected CSS + domClass.add(node, "mblComboBoxMenuItemSelected"); + }, + + onDeselect: function(/*DomNode*/ node){ + // summary: + // Remove selected CSS + domClass.remove(node, "mblComboBoxMenuItemSelected"); + }, + + onOpen: function(){ + this.scrollable.init({ + domNode: this.domNode, + containerNode: this.containerNode + }); + this.scrollable.scrollTo({x:0, y:0}); + }, + + onClose: function(){ + this.scrollable.cleanup(); + }, + + destroyRendering: function(){ + this.bgIframe = false; // no iframe to destroy + this.inherited(arguments); + }, + + postCreate: function(){ + this.inherited(arguments); + this.scrollable = new Scrollable(dojo, dojox); + this.scrollable.resize = function(){}; // resize changes the height rudely + this.scrollable.androidWorkaroud = false; // disable Android workaround + } + }); +}); |
