dijit.form.DropDownButton._openDropDown
dojo.require("dijit.form.Button");
defined in dijit/form/Button.js
Usage
function () (view source)
var dropDown = this.dropDown; var oldWidth=dropDown.domNode.style.width; var self = this; dijit.popup.open({ parent: this, popup: dropDown, around: this.domNode, orient: // TODO: add user-defined positioning option, like in Tooltip.js this.isLeftToRight() ? {'BL':'TL', 'BR':'TR', 'TL':'BL', 'TR':'BR'} : {'BR':'TR', 'BL':'TL', 'TR':'BR', 'TL':'BL'}, onExecute: function(){ self._closeDropDown(true); }, onCancel: function(){ self._closeDropDown(true); }, onClose: function(){ dropDown.domNode.style.width = oldWidth; self.popupStateNode.removeAttribute("popupActive"); this._opened = false; } }); if(this.domNode.offsetWidth > dropDown.domNode.offsetWidth){ var adjustNode = null; if(!this.isLeftToRight()){ adjustNode = dropDown.domNode.parentNode; var oldRight = adjustNode.offsetLeft + adjustNode.offsetWidth; } // make menu at least as wide as the button dojo.marginBox(dropDown.domNode, {w: this.domNode.offsetWidth}); if(adjustNode){ adjustNode.style.left = oldRight - this.domNode.offsetWidth + "px"; } } this.popupStateNode.setAttribute("popupActive", "true"); this._opened=true; if(dropDown.focus){ dropDown.focus(); } // TODO: set this.checked and call setStateClass(), to affect button look while drop down is shown