必要な機能を備えたjsfiddleを修正しました。
DropDownButtondojo.connect
のイベントにを追加することでこれを修正しました。onMouseDown
DropDownButtonのx位置と幅からContentPaneの新しいx位置を計算します。次に、ContentPaneのDOMノードの親ノードノードを見つけ、そのleft
スタイルパラメーターをその新しいx位置に設定します。
dojo.connect(dijit.byId("mapOverlayDropdown"), 'onMouseDown', function() {
console.log("shown");
var button = dijit.byId("mapOverlayDropdown").domNode;
var gallery = dijit.byId("mapOverlayGallery").domNode.parentNode;
var buttonPos = dojo.position(button, true);
var galleryPos = dojo.position(gallery, true);
var newX = buttonPos.x + buttonPos.w - galleryPos.w;
gallery.style.left = newX.toString() + "px";
});