[Dojo-checkins] bill - r3681 - in trunk/src/widget: . html
dojo-checkins-admin at dojotoolkit.org
dojo-checkins-admin at dojotoolkit.org
Thu Apr 27 07:29:05 MDT 2006
Author: bill
Date: Thu Apr 27 07:29:05 2006
New Revision: 3681
Modified:
trunk/src/widget/Menu2.js
trunk/src/widget/html/Button2.js
Log:
Rollback previous check in to Button2. Now that absolute
positioning is working correctly there's no need for the
"inverted" flag.
The Menu2 code is using positions relative to the viewport,
rather than positions relative to the document (like most
other code). I wonder if that's a bad idea.
Modified: trunk/src/widget/Menu2.js
==============================================================================
--- trunk/src/widget/Menu2.js (original)
+++ trunk/src/widget/Menu2.js Thu Apr 27 07:29:05 2006
@@ -216,6 +216,10 @@
this.menuHeight = dojo.style.getOuterHeight(this.domNode);
},
+ /**
+ * Open the menu at position (x,y), relative to the viewport
+ * (usually positions are relative to the document; why is this different??)
+ */
open: function(x, y, parent, explodeSrc){
// if explodeSrc isn't specified then explode from my parent widget
Modified: trunk/src/widget/html/Button2.js
==============================================================================
--- trunk/src/widget/html/Button2.js (original)
+++ trunk/src/widget/html/Button2.js Thu Apr 27 07:29:05 2006
@@ -102,9 +102,8 @@
if ( !menu ) { return; }
if ( menu.open && !menu.isShowing) {
- var x = dojo.style.getAbsoluteX(this.domNode, 'inverted');
- var y = dojo.style.getAbsoluteY(this.domNode, 'inverted') + this.height;
- menu.open(x, y, this);
+ var pos = dojo.style.getAbsolutePosition(this.domNode, false);
+ menu.open(pos.x, pos.y+this.height, this);
} else if ( menu.close && menu.isShowing ){
menu.close();
} else {
More information about the Dojo-checkins
mailing list