|
@@ -3,7 +3,7 @@ define([
|
|
|
'../utils'
|
|
|
], function ($, Utils) {
|
|
|
function AttachBody (decorated, $element, options) {
|
|
|
- this.$dropdownParent = options.get('dropdownParent') || document.body;
|
|
|
+ this.$dropdownParent = options.get('dropdownParent') || $(document.body);
|
|
|
|
|
|
decorated.call(this, $element, options);
|
|
|
}
|
|
@@ -157,6 +157,14 @@ define([
|
|
|
top: container.bottom
|
|
|
};
|
|
|
|
|
|
+ // Fix positioning with static parents
|
|
|
+ if (this.$dropdownParent[0].style.position !== 'static') {
|
|
|
+ var parentOffset = this.$dropdownParent.offset();
|
|
|
+
|
|
|
+ css.top -= parentOffset.top;
|
|
|
+ css.left -= parentOffset.left;
|
|
|
+ }
|
|
|
+
|
|
|
if (!isCurrentlyAbove && !isCurrentlyBelow) {
|
|
|
newDirection = 'below';
|
|
|
}
|