@ -416,27 +416,28 @@
} ;
} ;
} ,
} ,
getBottomAdaptPosition : function ( combo , popup , extraHeight , needAdaptHeight ) {
getBottomAdaptPosition : function ( combo , popup , extraHeight , needAdaptHeight , positionRelativeElement ) {
var comboBounds = combo . element [ 0 ] . getBoundingClientRect ( ) ,
var comboBounds = combo . element [ 0 ] . getBoundingClientRect ( ) ,
popupBounds = popup . element [ 0 ] . getBoundingClientRect ( ) ,
popupBounds = popup . element [ 0 ] . getBoundingClientRect ( ) ,
windowBounds = BI . Widget . _renderEngine . createElement ( "body" ) . bounds ( ) ;
viewportBounds = document . documentElement . getBoundingClientRect ( ) ,
positionRelativeElementRect = positionRelativeElement . getBoundingClientRect ( ) ;
if ( BI . DOM . isBottomSpaceEnough ( combo , popup , extraHeight ) ) {
if ( BI . DOM . isBottomSpaceEnough ( combo , popup , extraHeight ) ) {
return BI . DOM . getBottomPosition ( combo , popup , extraHeight ) ;
return BI . DOM . getBottomPosition ( combo , popup , extraHeight , positionRelativeElement ) ;
}
}
if ( needAdaptHeight ) {
if ( needAdaptHeight ) {
return {
return {
top : comboBounds . top + comboBounds . height + extraHeight ,
top : comboBounds . top + comboBounds . height + extraHeight - positionRelativeElementRect . top ,
adaptHeight : window Bounds. height - comboBounds . top - comboBounds . height - extraHeight
adaptHeight : viewport Bounds. height - comboBounds . top - comboBounds . height - extraHeight
} ;
} ;
}
}
if ( popupBounds . height + extraHeight > window Bounds. height ) {
if ( popupBounds . height + extraHeight > viewport Bounds. height ) {
return {
return {
top : extraHeight ,
top : extraHeight - positionRelativeElementRect . top ,
adaptHeight : window Bounds. height - extraHeight
adaptHeight : viewport Bounds. height - extraHeight
} ;
} ;
}
}
return {
return {
top : window Bounds. height - popupBounds . height - extraHeight
top : viewport Bounds. height - popupBounds . height - extraHeight - positionRelativeElementRect . top
} ;
} ;
} ,
} ,